--- a/devtools/client/shared/vendor/react-virtualized.js
+++ b/devtools/client/shared/vendor/react-virtualized.js
@@ -2,18 +2,17 @@ var REACT_PATH = "devtools/client/shared
var REACT_DOM_PATH = "devtools/client/shared/vendor/react-dom";
var REACT_SHALLOW_COMPARE = "devtools/client/shared/vendor/react-addons-shallow-compare";
!function(root, factory) {
let React = require(REACT_PATH);
let shallowCompare = require(REACT_SHALLOW_COMPARE);
let ReactDOM = require(REACT_DOM_PATH);
module.exports = factory(React, shallowCompare, ReactDOM);
-}(this, function(__WEBPACK_EXTERNAL_MODULE_89__, __WEBPACK_EXTERNAL_MODULE_90__, __WEBPACK_EXTERNAL_MODULE_96__) {
- /******/
+}(this, function(__WEBPACK_EXTERNAL_MODULE_89__, __WEBPACK_EXTERNAL_MODULE_90__, __WEBPACK_EXTERNAL_MODULE_96__) { /******/
return function(modules) {
/******/
/******/
// The require function
/******/
function __webpack_require__(moduleId) {
/******/
/******/
@@ -81,55 +80,50 @@ var REACT_SHALLOW_COMPARE = "devtools/cl
});
var _ArrowKeyStepper = __webpack_require__(1);
Object.defineProperty(exports, "ArrowKeyStepper", {
enumerable: !0,
get: function() {
return _ArrowKeyStepper.ArrowKeyStepper;
}
});
- var _AutoSizer = __webpack_require__(91);
+ var _AutoSizer = __webpack_require__(90);
Object.defineProperty(exports, "AutoSizer", {
enumerable: !0,
get: function() {
return _AutoSizer.AutoSizer;
}
});
- var _CellMeasurer = __webpack_require__(94);
+ var _CellMeasurer = __webpack_require__(93);
Object.defineProperty(exports, "CellMeasurer", {
enumerable: !0,
get: function() {
return _CellMeasurer.CellMeasurer;
}
- }), Object.defineProperty(exports, "defaultCellMeasurerCellSizeCache", {
+ }), Object.defineProperty(exports, "CellMeasurerCache", {
enumerable: !0,
get: function() {
- return _CellMeasurer.defaultCellSizeCache;
- }
- }), Object.defineProperty(exports, "uniformSizeCellMeasurerCellSizeCache", {
- enumerable: !0,
- get: function() {
- return _CellMeasurer.defaultCellSizeCache;
+ return _CellMeasurer.CellMeasurerCache;
}
});
var _Collection = __webpack_require__(98);
Object.defineProperty(exports, "Collection", {
enumerable: !0,
get: function() {
return _Collection.Collection;
}
});
var _ColumnSizer = __webpack_require__(118);
Object.defineProperty(exports, "ColumnSizer", {
enumerable: !0,
get: function() {
return _ColumnSizer.ColumnSizer;
}
});
- var _Table = __webpack_require__(128);
+ var _Table = __webpack_require__(120);
Object.defineProperty(exports, "defaultTableCellDataGetter", {
enumerable: !0,
get: function() {
return _Table.defaultCellDataGetter;
}
}), Object.defineProperty(exports, "defaultTableCellRenderer", {
enumerable: !0,
get: function() {
@@ -161,17 +155,17 @@ var REACT_SHALLOW_COMPARE = "devtools/cl
return _Table.SortDirection;
}
}), Object.defineProperty(exports, "SortIndicator", {
enumerable: !0,
get: function() {
return _Table.SortIndicator;
}
});
- var _Grid = __webpack_require__(120);
+ var _Grid = __webpack_require__(128);
Object.defineProperty(exports, "defaultCellRangeRenderer", {
enumerable: !0,
get: function() {
return _Grid.defaultCellRangeRenderer;
}
}), Object.defineProperty(exports, "Grid", {
enumerable: !0,
get: function() {
@@ -180,31 +174,38 @@ var REACT_SHALLOW_COMPARE = "devtools/cl
});
var _InfiniteLoader = __webpack_require__(137);
Object.defineProperty(exports, "InfiniteLoader", {
enumerable: !0,
get: function() {
return _InfiniteLoader.InfiniteLoader;
}
});
- var _ScrollSync = __webpack_require__(139);
+ var _List = __webpack_require__(139);
+ Object.defineProperty(exports, "List", {
+ enumerable: !0,
+ get: function() {
+ return _List.List;
+ }
+ });
+ var _MultiGrid = __webpack_require__(144);
+ Object.defineProperty(exports, "MultiGrid", {
+ enumerable: !0,
+ get: function() {
+ return _MultiGrid.MultiGrid;
+ }
+ });
+ var _ScrollSync = __webpack_require__(146);
Object.defineProperty(exports, "ScrollSync", {
enumerable: !0,
get: function() {
return _ScrollSync.ScrollSync;
}
});
- var _List = __webpack_require__(141);
- Object.defineProperty(exports, "List", {
- enumerable: !0,
- get: function() {
- return _List.List;
- }
- });
- var _WindowScroller = __webpack_require__(143);
+ var _WindowScroller = __webpack_require__(148);
Object.defineProperty(exports, "WindowScroller", {
enumerable: !0,
get: function() {
return _WindowScroller.WindowScroller;
}
});
}, /* 1 */
/***/
@@ -227,85 +228,107 @@ var REACT_SHALLOW_COMPARE = "devtools/cl
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
Object.defineProperty(exports, "__esModule", {
value: !0
});
- var _getPrototypeOf = __webpack_require__(3), _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf), _classCallCheck2 = __webpack_require__(29), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _createClass2 = __webpack_require__(30), _createClass3 = _interopRequireDefault(_createClass2), _possibleConstructorReturn2 = __webpack_require__(34), _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2), _inherits2 = __webpack_require__(81), _inherits3 = _interopRequireDefault(_inherits2), _react = __webpack_require__(89), _react2 = _interopRequireDefault(_react), _reactAddonsShallowCompare = __webpack_require__(90), _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare), ArrowKeyStepper = function(_Component) {
+ var _getPrototypeOf = __webpack_require__(3), _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf), _classCallCheck2 = __webpack_require__(29), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _createClass2 = __webpack_require__(30), _createClass3 = _interopRequireDefault(_createClass2), _possibleConstructorReturn2 = __webpack_require__(34), _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2), _inherits2 = __webpack_require__(81), _inherits3 = _interopRequireDefault(_inherits2), _react = __webpack_require__(89), _react2 = _interopRequireDefault(_react), ArrowKeyStepper = function(_PureComponent) {
function ArrowKeyStepper(props, context) {
(0, _classCallCheck3.default)(this, ArrowKeyStepper);
var _this = (0, _possibleConstructorReturn3.default)(this, (ArrowKeyStepper.__proto__ || (0,
_getPrototypeOf2.default)(ArrowKeyStepper)).call(this, props, context));
return _this.state = {
- scrollToColumn: 0,
- scrollToRow: 0
+ scrollToColumn: props.scrollToColumn,
+ scrollToRow: props.scrollToRow
}, _this._columnStartIndex = 0, _this._columnStopIndex = 0, _this._rowStartIndex = 0,
_this._rowStopIndex = 0, _this._onKeyDown = _this._onKeyDown.bind(_this), _this._onSectionRendered = _this._onSectionRendered.bind(_this),
_this;
}
- return (0, _inherits3.default)(ArrowKeyStepper, _Component), (0, _createClass3.default)(ArrowKeyStepper, [ {
+ return (0, _inherits3.default)(ArrowKeyStepper, _PureComponent), (0, _createClass3.default)(ArrowKeyStepper, [ {
+ key: "componentWillReceiveProps",
+ value: function(nextProps) {
+ var scrollToColumn = nextProps.scrollToColumn, scrollToRow = nextProps.scrollToRow, _props = this.props, prevScrollToColumn = _props.scrollToColumn, prevScrollToRow = _props.scrollToRow;
+ prevScrollToColumn !== scrollToColumn && prevScrollToRow !== scrollToRow ? this.setState({
+ scrollToColumn: scrollToColumn,
+ scrollToRow: scrollToRow
+ }) : prevScrollToColumn !== scrollToColumn ? this.setState({
+ scrollToColumn: scrollToColumn
+ }) : prevScrollToRow !== scrollToRow && this.setState({
+ scrollToRow: scrollToRow
+ });
+ }
+ }, {
+ key: "setScrollIndexes",
+ value: function(_ref) {
+ var scrollToColumn = _ref.scrollToColumn, scrollToRow = _ref.scrollToRow;
+ this.setState({
+ scrollToRow: scrollToRow,
+ scrollToColumn: scrollToColumn
+ });
+ }
+ }, {
key: "render",
value: function() {
- var _props = this.props, className = _props.className, children = _props.children, _state = this.state, scrollToColumn = _state.scrollToColumn, scrollToRow = _state.scrollToRow;
+ var _props2 = this.props, className = _props2.className, children = _props2.children, _state = this.state, scrollToColumn = _state.scrollToColumn, scrollToRow = _state.scrollToRow;
return _react2.default.createElement("div", {
className: className,
onKeyDown: this._onKeyDown
}, children({
onSectionRendered: this._onSectionRendered,
scrollToColumn: scrollToColumn,
scrollToRow: scrollToRow
}));
}
}, {
- key: "shouldComponentUpdate",
- value: function(nextProps, nextState) {
- return (0, _reactAddonsShallowCompare2.default)(this, nextProps, nextState);
- }
- }, {
key: "_onKeyDown",
value: function(event) {
- var _props2 = this.props, columnCount = _props2.columnCount, rowCount = _props2.rowCount;
- switch (event.key) {
- case "ArrowDown":
- event.preventDefault(), this.setState({
- scrollToRow: Math.min(this._rowStopIndex + 1, rowCount - 1)
- });
- break;
+ var _props3 = this.props, columnCount = _props3.columnCount, disabled = _props3.disabled, mode = _props3.mode, rowCount = _props3.rowCount;
+ if (!disabled) {
+ var _state2 = this.state, scrollToColumnPrevious = _state2.scrollToColumn, scrollToRowPrevious = _state2.scrollToRow, _state3 = this.state, scrollToColumn = _state3.scrollToColumn, scrollToRow = _state3.scrollToRow;
+ switch (event.key) {
+ case "ArrowDown":
+ scrollToRow = "cells" === mode ? Math.min(scrollToRow + 1, rowCount - 1) : Math.min(this._rowStopIndex + 1, rowCount - 1);
+ break;
+
+ case "ArrowLeft":
+ scrollToColumn = "cells" === mode ? Math.max(scrollToColumn - 1, 0) : Math.max(this._columnStartIndex - 1, 0);
+ break;
- case "ArrowLeft":
- event.preventDefault(), this.setState({
- scrollToColumn: Math.max(this._columnStartIndex - 1, 0)
- });
- break;
+ case "ArrowRight":
+ scrollToColumn = "cells" === mode ? Math.min(scrollToColumn + 1, columnCount - 1) : Math.min(this._columnStopIndex + 1, columnCount - 1);
+ break;
- case "ArrowRight":
- event.preventDefault(), this.setState({
- scrollToColumn: Math.min(this._columnStopIndex + 1, columnCount - 1)
- });
- break;
-
- case "ArrowUp":
- event.preventDefault(), this.setState({
- scrollToRow: Math.max(this._rowStartIndex - 1, 0)
- });
+ case "ArrowUp":
+ scrollToRow = "cells" === mode ? Math.max(scrollToRow - 1, 0) : Math.max(this._rowStartIndex - 1, 0);
+ }
+ scrollToColumn === scrollToColumnPrevious && scrollToRow === scrollToRowPrevious || (event.preventDefault(),
+ this.setState({
+ scrollToColumn: scrollToColumn,
+ scrollToRow: scrollToRow
+ }));
}
}
}, {
key: "_onSectionRendered",
- value: function(_ref) {
- var columnStartIndex = _ref.columnStartIndex, columnStopIndex = _ref.columnStopIndex, rowStartIndex = _ref.rowStartIndex, rowStopIndex = _ref.rowStopIndex;
+ value: function(_ref2) {
+ var columnStartIndex = _ref2.columnStartIndex, columnStopIndex = _ref2.columnStopIndex, rowStartIndex = _ref2.rowStartIndex, rowStopIndex = _ref2.rowStopIndex;
this._columnStartIndex = columnStartIndex, this._columnStopIndex = columnStopIndex,
this._rowStartIndex = rowStartIndex, this._rowStopIndex = rowStopIndex;
}
} ]), ArrowKeyStepper;
- }(_react.Component);
- exports.default = ArrowKeyStepper;
+ }(_react.PureComponent);
+ ArrowKeyStepper.defaultProps = {
+ disabled: !1,
+ mode: "edges",
+ scrollToColumn: 0,
+ scrollToRow: 0
+ }, exports.default = ArrowKeyStepper;
}, /* 3 */
/***/
function(module, exports, __webpack_require__) {
module.exports = {
default: __webpack_require__(4),
__esModule: !0
};
}, /* 4 */
@@ -538,17 +561,17 @@ var REACT_SHALLOW_COMPARE = "devtools/cl
return !0;
}
};
}, /* 26 */
/***/
function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(22), document = __webpack_require__(12).document, is = isObject(document) && isObject(document.createElement);
module.exports = function(it) {
- return is ? document.createElementNS("http://www.w3.org/1999/xhtml",it) : {};
+ return is ? document.createElement(it) : {};
};
}, /* 27 */
/***/
function(module, exports, __webpack_require__) {
// 7.1.1 ToPrimitive(input [, PreferredType])
var isObject = __webpack_require__(22);
// instead of the ES6 spec version, we didn't implement @@toPrimitive case
// and the second argument - flag - preferred type is a string
@@ -1315,56 +1338,52 @@ var REACT_SHALLOW_COMPARE = "devtools/cl
create: __webpack_require__(46)
});
}, /* 89 */
/***/
function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_89__;
}, /* 90 */
/***/
- function(module, exports) {
- module.exports = __WEBPACK_EXTERNAL_MODULE_90__;
+ function(module, exports, __webpack_require__) {
+ "use strict";
+ function _interopRequireDefault(obj) {
+ return obj && obj.__esModule ? obj : {
+ default: obj
+ };
+ }
+ Object.defineProperty(exports, "__esModule", {
+ value: !0
+ }), exports.AutoSizer = exports.default = void 0;
+ var _AutoSizer2 = __webpack_require__(91), _AutoSizer3 = _interopRequireDefault(_AutoSizer2);
+ exports.default = _AutoSizer3.default, exports.AutoSizer = _AutoSizer3.default;
}, /* 91 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
Object.defineProperty(exports, "__esModule", {
value: !0
- }), exports.AutoSizer = exports.default = void 0;
- var _AutoSizer2 = __webpack_require__(92), _AutoSizer3 = _interopRequireDefault(_AutoSizer2);
- exports.default = _AutoSizer3.default, exports.AutoSizer = _AutoSizer3.default;
- }, /* 92 */
- /***/
- function(module, exports, __webpack_require__) {
- "use strict";
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- default: obj
- };
- }
- Object.defineProperty(exports, "__esModule", {
- value: !0
});
- var _getPrototypeOf = __webpack_require__(3), _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf), _classCallCheck2 = __webpack_require__(29), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _createClass2 = __webpack_require__(30), _createClass3 = _interopRequireDefault(_createClass2), _possibleConstructorReturn2 = __webpack_require__(34), _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2), _inherits2 = __webpack_require__(81), _inherits3 = _interopRequireDefault(_inherits2), _react = __webpack_require__(89), _react2 = _interopRequireDefault(_react), _reactAddonsShallowCompare = __webpack_require__(90), _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare), _detectElementResize = __webpack_require__(93), _detectElementResize2 = _interopRequireDefault(_detectElementResize), AutoSizer = function(_Component) {
+ var _getPrototypeOf = __webpack_require__(3), _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf), _classCallCheck2 = __webpack_require__(29), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _createClass2 = __webpack_require__(30), _createClass3 = _interopRequireDefault(_createClass2), _possibleConstructorReturn2 = __webpack_require__(34), _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2), _inherits2 = __webpack_require__(81), _inherits3 = _interopRequireDefault(_inherits2), _react = __webpack_require__(89), _react2 = _interopRequireDefault(_react), _detectElementResize = __webpack_require__(92), _detectElementResize2 = _interopRequireDefault(_detectElementResize), AutoSizer = function(_PureComponent) {
function AutoSizer(props) {
(0, _classCallCheck3.default)(this, AutoSizer);
var _this = (0, _possibleConstructorReturn3.default)(this, (AutoSizer.__proto__ || (0,
_getPrototypeOf2.default)(AutoSizer)).call(this, props));
return _this.state = {
height: 0,
width: 0
}, _this._onResize = _this._onResize.bind(_this), _this._setRef = _this._setRef.bind(_this),
_this;
}
- return (0, _inherits3.default)(AutoSizer, _Component), (0, _createClass3.default)(AutoSizer, [ {
+ return (0, _inherits3.default)(AutoSizer, _PureComponent), (0, _createClass3.default)(AutoSizer, [ {
key: "componentDidMount",
value: function() {
this._parentNode = this._autoSizer.parentNode, this._detectElementResize = (0, _detectElementResize2.default)(),
this._detectElementResize.addResizeListener(this._parentNode, this._onResize), this._onResize();
}
}, {
key: "componentWillUnmount",
value: function() {
@@ -1381,50 +1400,45 @@ var REACT_SHALLOW_COMPARE = "devtools/cl
ref: this._setRef,
style: outerStyle
}, children({
height: height,
width: width
}));
}
}, {
- key: "shouldComponentUpdate",
- value: function(nextProps, nextState) {
- return (0, _reactAddonsShallowCompare2.default)(this, nextProps, nextState);
- }
- }, {
key: "_onResize",
value: function() {
- var onResize = this.props.onResize, boundingRect = this._parentNode.getBoundingClientRect(), height = boundingRect.height || 0, width = boundingRect.width || 0, style = window.getComputedStyle(this._parentNode), paddingLeft = parseInt(style.paddingLeft, 10) || 0, paddingRight = parseInt(style.paddingRight, 10) || 0, paddingTop = parseInt(style.paddingTop, 10) || 0, paddingBottom = parseInt(style.paddingBottom, 10) || 0;
+ var onResize = this.props.onResize, boundingRect = this._parentNode.getBoundingClientRect(), height = boundingRect.height || 0, width = boundingRect.width || 0, style = window.getComputedStyle(this._parentNode) || {}, paddingLeft = parseInt(style.paddingLeft, 10) || 0, paddingRight = parseInt(style.paddingRight, 10) || 0, paddingTop = parseInt(style.paddingTop, 10) || 0, paddingBottom = parseInt(style.paddingBottom, 10) || 0;
this.setState({
height: height - paddingTop - paddingBottom,
width: width - paddingLeft - paddingRight
}), onResize({
height: height,
width: width
});
}
}, {
key: "_setRef",
value: function(autoSizer) {
this._autoSizer = autoSizer;
}
} ]), AutoSizer;
- }(_react.Component);
+ }(_react.PureComponent);
AutoSizer.defaultProps = {
onResize: function() {}
}, exports.default = AutoSizer;
- }, /* 93 */
+ }, /* 92 */
/***/
function(module, exports) {
"use strict";
function createDetectElementResize() {
var _window;
_window = "undefined" != typeof window ? window : "undefined" != typeof self ? self : this;
- var attachEvent = "undefined" != typeof document && document.attachEvent, stylesCreated = !1;
+ var attachEvent = "undefined" != typeof document && document.attachEvent;
if (!attachEvent) {
var requestFrame = function() {
var raf = _window.requestAnimationFrame || _window.mozRequestAnimationFrame || _window.webkitRequestAnimationFrame || function(fn) {
return _window.setTimeout(fn, 20);
};
return function(fn) {
return raf(fn);
};
@@ -1445,288 +1459,357 @@ var REACT_SHALLOW_COMPARE = "devtools/cl
var element = this;
resetTriggers(this), this.__resizeRAF__ && cancelFrame(this.__resizeRAF__), this.__resizeRAF__ = requestFrame(function() {
checkTriggers(element) && (element.__resizeLast__.width = element.offsetWidth, element.__resizeLast__.height = element.offsetHeight,
element.__resizeListeners__.forEach(function(fn) {
fn.call(element, e);
}));
});
}
- }, animation = !1, animationstring = "animation", keyframeprefix = "", animationstartevent = "animationstart", domPrefixes = "Webkit Moz O ms".split(" "), startEvents = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "), pfx = "", elm = document.createElementNS("http://www.w3.org/1999/xhtml","fakeelement");
+ }, animation = !1, animationstring = "animation", keyframeprefix = "", animationstartevent = "animationstart", domPrefixes = "Webkit Moz O ms".split(" "), startEvents = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "), pfx = "", elm = document.createElement("fakeelement");
if (void 0 !== elm.style.animationName && (animation = !0), animation === !1) for (var i = 0; i < domPrefixes.length; i++) if (void 0 !== elm.style[domPrefixes[i] + "AnimationName"]) {
pfx = domPrefixes[i], animationstring = pfx + "Animation", keyframeprefix = "-" + pfx.toLowerCase() + "-",
animationstartevent = startEvents[i], animation = !0;
break;
}
var animationName = "resizeanim", animationKeyframes = "@" + keyframeprefix + "keyframes " + animationName + " { from { opacity: 0; } to { opacity: 0; } } ", animationStyle = keyframeprefix + "animation: 1ms " + animationName + "; ";
}
var createStyles = function() {
- if (!stylesCreated) {
- var css = (animationKeyframes ? animationKeyframes : "") + ".resize-triggers { " + (animationStyle ? animationStyle : "") + 'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }', head = document.firstElementChild || document.getElementsByTagName("head")[0], style = document.createElementNS("http://www.w3.org/1999/xhtml","style");
- style.type = "text/css", style.styleSheet ? style.styleSheet.cssText = css : style.appendChild(document.createTextNode(css)),
- head.appendChild(style), stylesCreated = !0;
+ if (!document.getElementById("detectElementResize")) {
+ var css = (animationKeyframes ? animationKeyframes : "") + ".resize-triggers { " + (animationStyle ? animationStyle : "") + 'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }', head = document.head || document.getElementsByTagName("head")[0], style = document.createElement("style");
+ style.id = "detectElementResize", style.type = "text/css", style.styleSheet ? style.styleSheet.cssText = css : style.appendChild(document.createTextNode(css)),
+ head.appendChild(style);
}
}, addResizeListener = function(element, fn) {
- attachEvent ? element.attachEvent("onresize", fn) : (element.__resizeTriggers__ || ("static" == _window.getComputedStyle(element).position && (element.style.position = "relative"),
- createStyles(), element.__resizeLast__ = {}, element.__resizeListeners__ = [], (element.__resizeTriggers__ = document.createElementNS("http://www.w3.org/1999/xhtml","div")).className = "resize-triggers",
- element.__resizeTriggers__.innerHTML = '<div class="expand-trigger"><div></div></div><div class="contract-trigger"></div>',
- element.appendChild(element.__resizeTriggers__), resetTriggers(element), element.addEventListener("scroll", scrollListener, !0),
- animationstartevent && (element.__resizeTriggers__.__animationListener__ = function(e) {
- e.animationName == animationName && resetTriggers(element);
- }, element.__resizeTriggers__.addEventListener(animationstartevent, element.__resizeTriggers__.__animationListener__))),
- element.__resizeListeners__.push(fn));
+ if (attachEvent) element.attachEvent("onresize", fn); else {
+ if (!element.__resizeTriggers__) {
+ var elementStyle = _window.getComputedStyle(element);
+ elementStyle && "static" == elementStyle.position && (element.style.position = "relative"),
+ createStyles(), element.__resizeLast__ = {}, element.__resizeListeners__ = [], (element.__resizeTriggers__ = document.createElement("div")).className = "resize-triggers",
+ element.__resizeTriggers__.innerHTML = '<div class="expand-trigger"><div></div></div><div class="contract-trigger"></div>',
+ element.appendChild(element.__resizeTriggers__), resetTriggers(element), element.addEventListener("scroll", scrollListener, !0),
+ animationstartevent && (element.__resizeTriggers__.__animationListener__ = function(e) {
+ e.animationName == animationName && resetTriggers(element);
+ }, element.__resizeTriggers__.addEventListener(animationstartevent, element.__resizeTriggers__.__animationListener__));
+ }
+ element.__resizeListeners__.push(fn);
+ }
}, removeResizeListener = function(element, fn) {
- attachEvent ? element.detachEvent("onresize", fn) : (element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn), 1),
- element.__resizeListeners__.length || (element.removeEventListener("scroll", scrollListener, !0),
- element.__resizeTriggers__.__animationListener__ && (element.__resizeTriggers__.removeEventListener(animationstartevent, element.__resizeTriggers__.__animationListener__),
- element.__resizeTriggers__.__animationListener__ = null), element.__resizeTriggers__ = !element.removeChild(element.__resizeTriggers__)));
+ if (attachEvent) element.detachEvent("onresize", fn); else if (element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn), 1),
+ !element.__resizeListeners__.length) {
+ element.removeEventListener("scroll", scrollListener, !0), element.__resizeTriggers__.__animationListener__ && (element.__resizeTriggers__.removeEventListener(animationstartevent, element.__resizeTriggers__.__animationListener__),
+ element.__resizeTriggers__.__animationListener__ = null);
+ try {
+ element.__resizeTriggers__ = !element.removeChild(element.__resizeTriggers__);
+ } catch (e) {}
+ }
};
return {
addResizeListener: addResizeListener,
removeResizeListener: removeResizeListener
};
}
Object.defineProperty(exports, "__esModule", {
value: !0
}), exports.default = createDetectElementResize;
- }, /* 94 */
- /***/
- function(module, exports, __webpack_require__) {
- "use strict";
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- default: obj
- };
- }
- Object.defineProperty(exports, "__esModule", {
- value: !0
- }), exports.defaultCellSizeCache = exports.CellMeasurer = exports.default = void 0;
- var _CellMeasurer2 = __webpack_require__(95), _CellMeasurer3 = _interopRequireDefault(_CellMeasurer2), _defaultCellSizeCache2 = __webpack_require__(97), _defaultCellSizeCache3 = _interopRequireDefault(_defaultCellSizeCache2);
- exports.default = _CellMeasurer3.default, exports.CellMeasurer = _CellMeasurer3.default,
- exports.defaultCellSizeCache = _defaultCellSizeCache3.default;
- }, /* 95 */
+ }, /* 93 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
Object.defineProperty(exports, "__esModule", {
value: !0
- });
- var _getPrototypeOf = __webpack_require__(3), _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf), _classCallCheck2 = __webpack_require__(29), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _createClass2 = __webpack_require__(30), _createClass3 = _interopRequireDefault(_createClass2), _possibleConstructorReturn2 = __webpack_require__(34), _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2), _inherits2 = __webpack_require__(81), _inherits3 = _interopRequireDefault(_inherits2), _react = __webpack_require__(89), _reactAddonsShallowCompare = (_interopRequireDefault(_react),
- __webpack_require__(90)), _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare), _reactDom = __webpack_require__(96), _reactDom2 = _interopRequireDefault(_reactDom), _defaultCellSizeCache = __webpack_require__(97), _defaultCellSizeCache2 = _interopRequireDefault(_defaultCellSizeCache), CellMeasurer = function(_Component) {
- function CellMeasurer(props, state) {
- (0, _classCallCheck3.default)(this, CellMeasurer);
- var _this = (0, _possibleConstructorReturn3.default)(this, (CellMeasurer.__proto__ || (0,
- _getPrototypeOf2.default)(CellMeasurer)).call(this, props, state));
- return _this._cellSizeCache = props.cellSizeCache || new _defaultCellSizeCache2.default(),
- _this.getColumnWidth = _this.getColumnWidth.bind(_this), _this.getRowHeight = _this.getRowHeight.bind(_this),
- _this.resetMeasurements = _this.resetMeasurements.bind(_this), _this.resetMeasurementForColumn = _this.resetMeasurementForColumn.bind(_this),
- _this.resetMeasurementForRow = _this.resetMeasurementForRow.bind(_this), _this;
+ }), exports.CellMeasurerCache = exports.CellMeasurer = exports.default = void 0;
+ var _CellMeasurer2 = __webpack_require__(94), _CellMeasurer3 = _interopRequireDefault(_CellMeasurer2), _CellMeasurerCache2 = __webpack_require__(97), _CellMeasurerCache3 = _interopRequireDefault(_CellMeasurerCache2);
+ exports.default = _CellMeasurer3.default, exports.CellMeasurer = _CellMeasurer3.default,
+ exports.CellMeasurerCache = _CellMeasurerCache3.default;
+ }, /* 94 */
+ /***/
+ function(module, exports, __webpack_require__) {
+ /* WEBPACK VAR INJECTION */
+ (function(process) {
+ "use strict";
+ function _interopRequireDefault(obj) {
+ return obj && obj.__esModule ? obj : {
+ default: obj
+ };
}
- return (0, _inherits3.default)(CellMeasurer, _Component), (0, _createClass3.default)(CellMeasurer, [ {
- key: "getColumnWidth",
- value: function(_ref) {
- var index = _ref.index;
- if (this._cellSizeCache.hasColumnWidth(index)) return this._cellSizeCache.getColumnWidth(index);
- for (var rowCount = this.props.rowCount, maxWidth = 0, rowIndex = 0; rowIndex < rowCount; rowIndex++) {
- var _measureCell2 = this._measureCell({
- clientWidth: !0,
- columnIndex: index,
- rowIndex: rowIndex
- }), width = _measureCell2.width;
- maxWidth = Math.max(maxWidth, width);
- }
- return this._cellSizeCache.setColumnWidth(index, maxWidth), maxWidth;
- }
- }, {
- key: "getRowHeight",
- value: function(_ref2) {
- var index = _ref2.index;
- if (this._cellSizeCache.hasRowHeight(index)) return this._cellSizeCache.getRowHeight(index);
- for (var columnCount = this.props.columnCount, maxHeight = 0, columnIndex = 0; columnIndex < columnCount; columnIndex++) {
- var _measureCell3 = this._measureCell({
- clientHeight: !0,
- columnIndex: columnIndex,
- rowIndex: index
- }), height = _measureCell3.height;
- maxHeight = Math.max(maxHeight, height);
- }
- return this._cellSizeCache.setRowHeight(index, maxHeight), maxHeight;
- }
- }, {
- key: "resetMeasurementForColumn",
- value: function(columnIndex) {
- this._cellSizeCache.clearColumnWidth(columnIndex);
- }
- }, {
- key: "resetMeasurementForRow",
- value: function(rowIndex) {
- this._cellSizeCache.clearRowHeight(rowIndex);
- }
- }, {
- key: "resetMeasurements",
- value: function() {
- this._cellSizeCache.clearAllColumnWidths(), this._cellSizeCache.clearAllRowHeights();
- }
- }, {
- key: "componentDidMount",
- value: function() {
- this._renderAndMount();
+ function warnAboutImproperUse(parent) {
+ "production" !== process.env.NODE_ENV && parent && void 0 === parent.props.deferredMeasurementCache && parent.__warnedAboutImproperUse !== !0 && (parent.__warnedAboutImproperUse = !0,
+ console.warn("CellMeasurer should be rendered within a Grid that has a deferredMeasurementCache prop."));
+ }
+ Object.defineProperty(exports, "__esModule", {
+ value: !0
+ });
+ var _getPrototypeOf = __webpack_require__(3), _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf), _classCallCheck2 = __webpack_require__(29), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _createClass2 = __webpack_require__(30), _createClass3 = _interopRequireDefault(_createClass2), _possibleConstructorReturn2 = __webpack_require__(34), _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2), _inherits2 = __webpack_require__(81), _inherits3 = _interopRequireDefault(_inherits2), _react = __webpack_require__(89), _reactDom = __webpack_require__(96), EMPTY_OBJECT = {}, CellMeasurer = function(_PureComponent) {
+ function CellMeasurer(props, context) {
+ (0, _classCallCheck3.default)(this, CellMeasurer);
+ var _this = (0, _possibleConstructorReturn3.default)(this, (CellMeasurer.__proto__ || (0,
+ _getPrototypeOf2.default)(CellMeasurer)).call(this, props, context));
+ return _this._measure = _this._measure.bind(_this), _this;
}
- }, {
- key: "componentWillReceiveProps",
- value: function(nextProps) {
- var cellSizeCache = this.props.cellSizeCache;
- cellSizeCache !== nextProps.cellSizeCache && (this._cellSizeCache = nextProps.cellSizeCache),
- this._updateDivDimensions(nextProps);
- }
- }, {
- key: "componentWillUnmount",
- value: function() {
- this._unmountContainer();
- }
- }, {
- key: "render",
- value: function() {
- var children = this.props.children;
- return children({
- getColumnWidth: this.getColumnWidth,
- getRowHeight: this.getRowHeight,
- resetMeasurements: this.resetMeasurements,
- resetMeasurementForColumn: this.resetMeasurementForColumn,
- resetMeasurementForRow: this.resetMeasurementForRow
- });
- }
- }, {
- key: "shouldComponentUpdate",
- value: function(nextProps, nextState) {
- return (0, _reactAddonsShallowCompare2.default)(this, nextProps, nextState);
- }
- }, {
- key: "_getContainerNode",
- value: function(props) {
- var container = props.container;
- return container ? _reactDom2.default.findDOMNode("function" == typeof container ? container() : container) : document.firstElementChild;
+ return (0, _inherits3.default)(CellMeasurer, _PureComponent), (0, _createClass3.default)(CellMeasurer, [ {
+ key: "componentDidMount",
+ value: function() {
+ this._maybeMeasureCell();
+ }
+ }, {
+ key: "componentDidUpdate",
+ value: function(prevProps, prevState) {
+ this._maybeMeasureCell();
+ }
+ }, {
+ key: "render",
+ value: function() {
+ var children = this.props.children;
+ if ("production" !== process.env.NODE_ENV) {
+ var _parent = this.props.parent;
+ warnAboutImproperUse(_parent);
+ }
+ return "function" == typeof children ? children({
+ measure: this._measure
+ }) : children;
+ }
+ }, {
+ key: "_maybeMeasureCell",
+ value: function() {
+ var _props = this.props, cache = _props.cache, columnIndex = _props.columnIndex, parent = _props.parent, rowIndex = _props.rowIndex;
+ if (!cache.has(rowIndex, columnIndex)) {
+ var node = (0, _reactDom.findDOMNode)(this), height = node.offsetHeight, width = node.offsetWidth;
+ cache.set(rowIndex, columnIndex, width, height), void 0 !== parent && parent.invalidateCellSizeAfterRender({
+ columnIndex: columnIndex,
+ rowIndex: rowIndex
+ });
+ }
+ }
+ }, {
+ key: "_measure",
+ value: function() {
+ var _props2 = this.props, cache = _props2.cache, columnIndex = _props2.columnIndex, parent = _props2.parent, rowIndex = _props2.rowIndex, node = (0,
+ _reactDom.findDOMNode)(this);
+ cache.hasFixedWidth() || (node.style.width = "auto"), cache.hasFixedHeight() || (node.style.height = "auto");
+ var height = node.offsetHeight, width = node.offsetWidth;
+ height === cache.getHeight(rowIndex, columnIndex) && width === cache.getWidth(rowIndex, columnIndex) || (cache.set(rowIndex, columnIndex, width, height),
+ parent.recomputeGridSize({
+ columnIndex: columnIndex,
+ rowIndex: rowIndex
+ }));
+ }
+ } ]), CellMeasurer;
+ }(_react.PureComponent);
+ CellMeasurer.defaultProps = {
+ style: EMPTY_OBJECT
+ }, exports.default = CellMeasurer;
+ }).call(exports, __webpack_require__(95));
+ }, /* 95 */
+ /***/
+ function(module, exports) {
+ function defaultSetTimout() {
+ throw new Error("setTimeout has not been defined");
+ }
+ function defaultClearTimeout() {
+ throw new Error("clearTimeout has not been defined");
+ }
+ function runTimeout(fun) {
+ if (cachedSetTimeout === setTimeout) //normal enviroments in sane situations
+ return setTimeout(fun, 0);
+ // if setTimeout wasn't available but was latter defined
+ if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) return cachedSetTimeout = setTimeout,
+ setTimeout(fun, 0);
+ try {
+ // when when somebody has screwed with setTimeout but no I.E. maddness
+ return cachedSetTimeout(fun, 0);
+ } catch (e) {
+ try {
+ // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
+ return cachedSetTimeout.call(null, fun, 0);
+ } catch (e) {
+ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
+ return cachedSetTimeout.call(this, fun, 0);
}
- }, {
- key: "_measureCell",
- value: function(_ref3) {
- var _ref3$clientHeight = _ref3.clientHeight, clientHeight = void 0 !== _ref3$clientHeight && _ref3$clientHeight, _ref3$clientWidth = _ref3.clientWidth, clientWidth = void 0 === _ref3$clientWidth || _ref3$clientWidth, columnIndex = _ref3.columnIndex, rowIndex = _ref3.rowIndex, cellRenderer = this.props.cellRenderer, rendered = cellRenderer({
- columnIndex: columnIndex,
- rowIndex: rowIndex
- });
- this._renderAndMount(), _reactDom2.default.unstable_renderSubtreeIntoContainer(this, rendered, this._div);
- var measurements = {
- height: clientHeight && this._div.clientHeight,
- width: clientWidth && this._div.clientWidth
- };
- return _reactDom2.default.unmountComponentAtNode(this._div), measurements;
+ }
+ }
+ function runClearTimeout(marker) {
+ if (cachedClearTimeout === clearTimeout) //normal enviroments in sane situations
+ return clearTimeout(marker);
+ // if clearTimeout wasn't available but was latter defined
+ if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) return cachedClearTimeout = clearTimeout,
+ clearTimeout(marker);
+ try {
+ // when when somebody has screwed with setTimeout but no I.E. maddness
+ return cachedClearTimeout(marker);
+ } catch (e) {
+ try {
+ // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
+ return cachedClearTimeout.call(null, marker);
+ } catch (e) {
+ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
+ // Some versions of I.E. have different rules for clearTimeout vs setTimeout
+ return cachedClearTimeout.call(this, marker);
+ }
+ }
+ }
+ function cleanUpNextTick() {
+ draining && currentQueue && (draining = !1, currentQueue.length ? queue = currentQueue.concat(queue) : queueIndex = -1,
+ queue.length && drainQueue());
+ }
+ function drainQueue() {
+ if (!draining) {
+ var timeout = runTimeout(cleanUpNextTick);
+ draining = !0;
+ for (var len = queue.length; len; ) {
+ for (currentQueue = queue, queue = []; ++queueIndex < len; ) currentQueue && currentQueue[queueIndex].run();
+ queueIndex = -1, len = queue.length;
}
- }, {
- key: "_renderAndMount",
- value: function() {
- this._div || (this._div = document.createElementNS("http://www.w3.org/1999/xhtml","div"), this._div.style.display = "inline-block",
- this._div.style.position = "absolute", this._div.style.visibility = "hidden", this._div.style.zIndex = -1,
- this._updateDivDimensions(this.props), this._containerNode = this._getContainerNode(this.props),
- this._containerNode.appendChild(this._div));
- }
- }, {
- key: "_unmountContainer",
- value: function() {
- this._div && (this._containerNode.removeChild(this._div), this._div = null), this._containerNode = null;
- }
- }, {
- key: "_updateDivDimensions",
- value: function(props) {
- var height = props.height, width = props.width;
- height && height !== this._divHeight && (this._divHeight = height, this._div.style.height = height + "px"),
- width && width !== this._divWidth && (this._divWidth = width, this._div.style.width = width + "px");
- }
- } ]), CellMeasurer;
- }(_react.Component);
- exports.default = CellMeasurer;
+ currentQueue = null, draining = !1, runClearTimeout(timeout);
+ }
+ }
+ // v8 likes predictible objects
+ function Item(fun, array) {
+ this.fun = fun, this.array = array;
+ }
+ function noop() {}
+ // shim for using process in browser
+ var cachedSetTimeout, cachedClearTimeout, process = module.exports = {};
+ !function() {
+ try {
+ cachedSetTimeout = "function" == typeof setTimeout ? setTimeout : defaultSetTimout;
+ } catch (e) {
+ cachedSetTimeout = defaultSetTimout;
+ }
+ try {
+ cachedClearTimeout = "function" == typeof clearTimeout ? clearTimeout : defaultClearTimeout;
+ } catch (e) {
+ cachedClearTimeout = defaultClearTimeout;
+ }
+ }();
+ var currentQueue, queue = [], draining = !1, queueIndex = -1;
+ process.nextTick = function(fun) {
+ var args = new Array(arguments.length - 1);
+ if (arguments.length > 1) for (var i = 1; i < arguments.length; i++) args[i - 1] = arguments[i];
+ queue.push(new Item(fun, args)), 1 !== queue.length || draining || runTimeout(drainQueue);
+ }, Item.prototype.run = function() {
+ this.fun.apply(null, this.array);
+ }, process.title = "browser", process.browser = !0, process.env = {}, process.argv = [],
+ process.version = "", // empty string to avoid regexp issues
+ process.versions = {}, process.on = noop, process.addListener = noop, process.once = noop,
+ process.off = noop, process.removeListener = noop, process.removeAllListeners = noop,
+ process.emit = noop, process.binding = function(name) {
+ throw new Error("process.binding is not supported");
+ }, process.cwd = function() {
+ return "/";
+ }, process.chdir = function(dir) {
+ throw new Error("process.chdir is not supported");
+ }, process.umask = function() {
+ return 0;
+ };
}, /* 96 */
/***/
function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_96__;
}, /* 97 */
/***/
function(module, exports, __webpack_require__) {
- "use strict";
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- default: obj
- };
- }
- Object.defineProperty(exports, "__esModule", {
- value: !0
- });
- var _classCallCheck2 = __webpack_require__(29), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _createClass2 = __webpack_require__(30), _createClass3 = _interopRequireDefault(_createClass2), CellSizeCache = function() {
- function CellSizeCache() {
- var _ref = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, _ref$uniformRowHeight = _ref.uniformRowHeight, uniformRowHeight = void 0 !== _ref$uniformRowHeight && _ref$uniformRowHeight, _ref$uniformColumnWid = _ref.uniformColumnWidth, uniformColumnWidth = void 0 !== _ref$uniformColumnWid && _ref$uniformColumnWid;
- (0, _classCallCheck3.default)(this, CellSizeCache), this._uniformRowHeight = uniformRowHeight,
- this._uniformColumnWidth = uniformColumnWidth, this._cachedColumnWidths = {}, this._cachedRowHeights = {};
+ /* WEBPACK VAR INJECTION */
+ (function(process) {
+ "use strict";
+ function _interopRequireDefault(obj) {
+ return obj && obj.__esModule ? obj : {
+ default: obj
+ };
+ }
+ function defaultKeyMapper(rowIndex, columnIndex) {
+ return rowIndex + "-" + columnIndex;
}
- return (0, _createClass3.default)(CellSizeCache, [ {
- key: "clearAllColumnWidths",
- value: function() {
- this._cachedColumnWidth = void 0, this._cachedColumnWidths = {};
- }
- }, {
- key: "clearAllRowHeights",
- value: function() {
- this._cachedRowHeight = void 0, this._cachedRowHeights = {};
- }
- }, {
- key: "clearColumnWidth",
- value: function(index) {
- this._cachedColumnWidth = void 0, delete this._cachedColumnWidths[index];
+ Object.defineProperty(exports, "__esModule", {
+ value: !0
+ }), exports.DEFAULT_WIDTH = exports.DEFAULT_HEIGHT = void 0;
+ var _classCallCheck2 = __webpack_require__(29), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _createClass2 = __webpack_require__(30), _createClass3 = _interopRequireDefault(_createClass2), DEFAULT_HEIGHT = exports.DEFAULT_HEIGHT = 30, DEFAULT_WIDTH = exports.DEFAULT_WIDTH = 100, CellMeasurerCache = function() {
+ function CellMeasurerCache() {
+ var _this = this, params = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
+ (0, _classCallCheck3.default)(this, CellMeasurerCache), this.columnWidth = function(_ref) {
+ var index = _ref.index;
+ return _this._columnWidthCache.hasOwnProperty(index) ? _this._columnWidthCache[index] : _this._defaultWidth;
+ }, this.rowHeight = function(_ref2) {
+ var index = _ref2.index;
+ return _this._rowHeightCache.hasOwnProperty(index) ? _this._rowHeightCache[index] : _this._defaultHeight;
+ };
+ var defaultHeight = params.defaultHeight, defaultWidth = params.defaultWidth, fixedHeight = params.fixedHeight, fixedWidth = params.fixedWidth, keyMapper = params.keyMapper, minHeight = params.minHeight, minWidth = params.minWidth;
+ this._hasFixedHeight = fixedHeight === !0, this._hasFixedWidth = fixedWidth === !0,
+ this._minHeight = minHeight || 0, this._minWidth = minWidth || 0, this._keyMapper = keyMapper || defaultKeyMapper,
+ this._defaultHeight = Math.max(this._minHeight, "number" == typeof defaultHeight ? defaultHeight : DEFAULT_HEIGHT),
+ this._defaultWidth = Math.max(this._minWidth, "number" == typeof defaultWidth ? defaultWidth : DEFAULT_WIDTH),
+ "production" !== process.env.NODE_ENV && (this._hasFixedHeight === !1 && this._hasFixedWidth === !1 && console.warn("CellMeasurerCache should only measure a cell's width or height. You have configured CellMeasurerCache to measure both. This will result in poor performance."),
+ this._hasFixedHeight === !1 && 0 === this._defaultHeight && console.warn("Fixed height CellMeasurerCache should specify a :defaultHeight greater than 0. Failing to do so will lead to unnecessary layout and poor performance."),
+ this._hasFixedWidth === !1 && 0 === this._defaultWidth && console.warn("Fixed width CellMeasurerCache should specify a :defaultWidth greater than 0. Failing to do so will lead to unnecessary layout and poor performance.")),
+ this._columnCount = 0, this._rowCount = 0, this._cellHeightCache = {}, this._cellWidthCache = {},
+ this._columnWidthCache = {}, this._rowHeightCache = {};
}
- }, {
- key: "clearRowHeight",
- value: function(index) {
- this._cachedRowHeight = void 0, delete this._cachedRowHeights[index];
- }
- }, {
- key: "getColumnWidth",
- value: function(index) {
- return this._uniformColumnWidth ? this._cachedColumnWidth : this._cachedColumnWidths[index];
- }
- }, {
- key: "getRowHeight",
- value: function(index) {
- return this._uniformRowHeight ? this._cachedRowHeight : this._cachedRowHeights[index];
- }
- }, {
- key: "hasColumnWidth",
- value: function(index) {
- return this._uniformColumnWidth ? !!this._cachedColumnWidth : !!this._cachedColumnWidths[index];
- }
- }, {
- key: "hasRowHeight",
- value: function(index) {
- return this._uniformRowHeight ? !!this._cachedRowHeight : !!this._cachedRowHeights[index];
- }
- }, {
- key: "setColumnWidth",
- value: function(index, width) {
- this._cachedColumnWidth = width, this._cachedColumnWidths[index] = width;
- }
- }, {
- key: "setRowHeight",
- value: function(index, height) {
- this._cachedRowHeight = height, this._cachedRowHeights[index] = height;
- }
- } ]), CellSizeCache;
- }();
- exports.default = CellSizeCache;
+ return (0, _createClass3.default)(CellMeasurerCache, [ {
+ key: "clear",
+ value: function(rowIndex, columnIndex) {
+ var key = this._keyMapper(rowIndex, columnIndex);
+ delete this._cellHeightCache[key], delete this._cellWidthCache[key], this._updateCachedColumnAndRowSizes(rowIndex, columnIndex);
+ }
+ }, {
+ key: "clearAll",
+ value: function() {
+ this._cellHeightCache = {}, this._cellWidthCache = {}, this._columnWidthCache = {},
+ this._rowHeightCache = {};
+ }
+ }, {
+ key: "hasFixedHeight",
+ value: function() {
+ return this._hasFixedHeight;
+ }
+ }, {
+ key: "hasFixedWidth",
+ value: function() {
+ return this._hasFixedWidth;
+ }
+ }, {
+ key: "getHeight",
+ value: function(rowIndex, columnIndex) {
+ var key = this._keyMapper(rowIndex, columnIndex);
+ return this._cellHeightCache.hasOwnProperty(key) ? Math.max(this._minHeight, this._cellHeightCache[key]) : this._defaultHeight;
+ }
+ }, {
+ key: "getWidth",
+ value: function(rowIndex, columnIndex) {
+ var key = this._keyMapper(rowIndex, columnIndex);
+ return this._cellWidthCache.hasOwnProperty(key) ? Math.max(this._minWidth, this._cellWidthCache[key]) : this._defaultWidth;
+ }
+ }, {
+ key: "has",
+ value: function(rowIndex, columnIndex) {
+ var key = this._keyMapper(rowIndex, columnIndex);
+ return this._cellHeightCache.hasOwnProperty(key);
+ }
+ }, {
+ key: "set",
+ value: function(rowIndex, columnIndex, width, height) {
+ var key = this._keyMapper(rowIndex, columnIndex);
+ columnIndex >= this._columnCount && (this._columnCount = columnIndex + 1), rowIndex >= this._rowCount && (this._rowCount = rowIndex + 1),
+ this._cellHeightCache[key] = height, this._cellWidthCache[key] = width, this._updateCachedColumnAndRowSizes(rowIndex, columnIndex);
+ }
+ }, {
+ key: "_updateCachedColumnAndRowSizes",
+ value: function(rowIndex, columnIndex) {
+ for (var columnWidth = 0, i = 0; i < this._rowCount; i++) columnWidth = Math.max(columnWidth, this.getWidth(i, columnIndex));
+ for (var rowHeight = 0, _i = 0; _i < this._columnCount; _i++) rowHeight = Math.max(rowHeight, this.getHeight(rowIndex, _i));
+ this._columnWidthCache[columnIndex] = columnWidth, this._rowHeightCache[rowIndex] = rowHeight;
+ }
+ } ]), CellMeasurerCache;
+ }();
+ exports.default = CellMeasurerCache;
+ }).call(exports, __webpack_require__(95));
}, /* 98 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
@@ -1740,18 +1823,18 @@ var REACT_SHALLOW_COMPARE = "devtools/cl
/***/
function(module, exports, __webpack_require__) {
"use strict";
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
- function defaultCellGroupRenderer(_ref5) {
- var cellCache = _ref5.cellCache, cellRenderer = _ref5.cellRenderer, cellSizeAndPositionGetter = _ref5.cellSizeAndPositionGetter, indices = _ref5.indices, isScrolling = _ref5.isScrolling;
+ function defaultCellGroupRenderer(_ref4) {
+ var cellCache = _ref4.cellCache, cellRenderer = _ref4.cellRenderer, cellSizeAndPositionGetter = _ref4.cellSizeAndPositionGetter, indices = _ref4.indices, isScrolling = _ref4.isScrolling;
return indices.map(function(index) {
var cellMetadata = cellSizeAndPositionGetter({
index: index
}), cellRendererProps = {
index: index,
isScrolling: isScrolling,
key: index,
style: {
@@ -1766,47 +1849,46 @@ var REACT_SHALLOW_COMPARE = "devtools/cl
cellCache[index]) : cellRenderer(cellRendererProps);
}).filter(function(renderedCell) {
return !!renderedCell;
});
}
Object.defineProperty(exports, "__esModule", {
value: !0
});
- var _extends2 = __webpack_require__(100), _extends3 = _interopRequireDefault(_extends2), _objectWithoutProperties2 = __webpack_require__(105), _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2), _getPrototypeOf = __webpack_require__(3), _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf), _classCallCheck2 = __webpack_require__(29), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _createClass2 = __webpack_require__(30), _createClass3 = _interopRequireDefault(_createClass2), _possibleConstructorReturn2 = __webpack_require__(34), _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2), _inherits2 = __webpack_require__(81), _inherits3 = _interopRequireDefault(_inherits2), _react = __webpack_require__(89), _react2 = _interopRequireDefault(_react), _CollectionView = __webpack_require__(106), _CollectionView2 = _interopRequireDefault(_CollectionView), _calculateSizeAndPositionData2 = __webpack_require__(114), _calculateSizeAndPositionData3 = _interopRequireDefault(_calculateSizeAndPositionData2), _getUpdatedOffsetForIndex = __webpack_require__(117), _getUpdatedOffsetForIndex2 = _interopRequireDefault(_getUpdatedOffsetForIndex), _reactAddonsShallowCompare = __webpack_require__(90), _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare), Collection = function(_Component) {
+ var _extends2 = __webpack_require__(100), _extends3 = _interopRequireDefault(_extends2), _objectWithoutProperties2 = __webpack_require__(105), _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2), _getPrototypeOf = __webpack_require__(3), _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf), _classCallCheck2 = __webpack_require__(29), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _createClass2 = __webpack_require__(30), _createClass3 = _interopRequireDefault(_createClass2), _possibleConstructorReturn2 = __webpack_require__(34), _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2), _inherits2 = __webpack_require__(81), _inherits3 = _interopRequireDefault(_inherits2), _react = __webpack_require__(89), _react2 = _interopRequireDefault(_react), _CollectionView = __webpack_require__(106), _CollectionView2 = _interopRequireDefault(_CollectionView), _calculateSizeAndPositionData2 = __webpack_require__(114), _calculateSizeAndPositionData3 = _interopRequireDefault(_calculateSizeAndPositionData2), _getUpdatedOffsetForIndex = __webpack_require__(117), _getUpdatedOffsetForIndex2 = _interopRequireDefault(_getUpdatedOffsetForIndex), Collection = function(_PureComponent) {
function Collection(props, context) {
(0, _classCallCheck3.default)(this, Collection);
var _this = (0, _possibleConstructorReturn3.default)(this, (Collection.__proto__ || (0,
_getPrototypeOf2.default)(Collection)).call(this, props, context));
return _this._cellMetadata = [], _this._lastRenderedCellIndices = [], _this._cellCache = [],
- _this._isScrollingChange = _this._isScrollingChange.bind(_this), _this;
+ _this._isScrollingChange = _this._isScrollingChange.bind(_this), _this._setCollectionViewRef = _this._setCollectionViewRef.bind(_this),
+ _this;
}
- return (0, _inherits3.default)(Collection, _Component), (0, _createClass3.default)(Collection, [ {
+ return (0, _inherits3.default)(Collection, _PureComponent), (0, _createClass3.default)(Collection, [ {
+ key: "forceUpdate",
+ value: function() {
+ void 0 !== this._collectionView && this._collectionView.forceUpdate();
+ }
+ }, {
key: "recomputeCellSizesAndPositions",
value: function() {
this._cellCache = [], this._collectionView.recomputeCellSizesAndPositions();
}
}, {
key: "render",
value: function() {
- var _this2 = this, props = (0, _objectWithoutProperties3.default)(this.props, []);
+ var props = (0, _objectWithoutProperties3.default)(this.props, []);
return _react2.default.createElement(_CollectionView2.default, (0, _extends3.default)({
cellLayoutManager: this,
isScrollingChange: this._isScrollingChange,
- ref: function(_ref) {
- _this2._collectionView = _ref;
- }
+ ref: this._setCollectionViewRef
}, props));
}
}, {
- key: "shouldComponentUpdate",
- value: function(nextProps, nextState) {
- return (0, _reactAddonsShallowCompare2.default)(this, nextProps, nextState);
- }
- }, {
key: "calculateSizeAndPositionData",
value: function() {
var _props = this.props, cellCount = _props.cellCount, cellSizeAndPositionGetter = _props.cellSizeAndPositionGetter, sectionSize = _props.sectionSize, data = (0,
_calculateSizeAndPositionData3.default)({
cellCount: cellCount,
cellSizeAndPositionGetter: cellSizeAndPositionGetter,
sectionSize: sectionSize
});
@@ -1815,18 +1897,18 @@ var REACT_SHALLOW_COMPARE = "devtools/cl
}
}, {
key: "getLastRenderedIndices",
value: function() {
return this._lastRenderedCellIndices;
}
}, {
key: "getScrollPositionForCell",
- value: function(_ref2) {
- var align = _ref2.align, cellIndex = _ref2.cellIndex, height = _ref2.height, scrollLeft = _ref2.scrollLeft, scrollTop = _ref2.scrollTop, width = _ref2.width, cellCount = this.props.cellCount;
+ value: function(_ref) {
+ var align = _ref.align, cellIndex = _ref.cellIndex, height = _ref.height, scrollLeft = _ref.scrollLeft, scrollTop = _ref.scrollTop, width = _ref.width, cellCount = this.props.cellCount;
if (cellIndex >= 0 && cellIndex < cellCount) {
var cellMetadata = this._cellMetadata[cellIndex];
scrollLeft = (0, _getUpdatedOffsetForIndex2.default)({
align: align,
cellOffset: cellMetadata.x,
cellSize: cellMetadata.width,
containerSize: width,
currentOffset: scrollLeft,
@@ -1850,43 +1932,48 @@ var REACT_SHALLOW_COMPARE = "devtools/cl
value: function() {
return {
height: this._height,
width: this._width
};
}
}, {
key: "cellRenderers",
- value: function(_ref3) {
- var _this3 = this, height = _ref3.height, isScrolling = _ref3.isScrolling, width = _ref3.width, x = _ref3.x, y = _ref3.y, _props2 = this.props, cellGroupRenderer = _props2.cellGroupRenderer, cellRenderer = _props2.cellRenderer;
+ value: function(_ref2) {
+ var _this2 = this, height = _ref2.height, isScrolling = _ref2.isScrolling, width = _ref2.width, x = _ref2.x, y = _ref2.y, _props2 = this.props, cellGroupRenderer = _props2.cellGroupRenderer, cellRenderer = _props2.cellRenderer;
return this._lastRenderedCellIndices = this._sectionManager.getCellIndices({
height: height,
width: width,
x: x,
y: y
}), cellGroupRenderer({
cellCache: this._cellCache,
cellRenderer: cellRenderer,
- cellSizeAndPositionGetter: function(_ref4) {
- var index = _ref4.index;
- return _this3._sectionManager.getCellMetadata({
+ cellSizeAndPositionGetter: function(_ref3) {
+ var index = _ref3.index;
+ return _this2._sectionManager.getCellMetadata({
index: index
});
},
indices: this._lastRenderedCellIndices,
isScrolling: isScrolling
});
}
}, {
key: "_isScrollingChange",
value: function(isScrolling) {
isScrolling || (this._cellCache = []);
}
+ }, {
+ key: "_setCollectionViewRef",
+ value: function(ref) {
+ this._collectionView = ref;
+ }
} ]), Collection;
- }(_react.Component);
+ }(_react.PureComponent);
Collection.defaultProps = {
"aria-label": "grid",
cellGroupRenderer: defaultCellGroupRenderer
}, exports.default = Collection;
}, /* 100 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
@@ -1956,40 +2043,39 @@ var REACT_SHALLOW_COMPARE = "devtools/cl
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
Object.defineProperty(exports, "__esModule", {
value: !0
});
- var _extends2 = __webpack_require__(100), _extends3 = _interopRequireDefault(_extends2), _getPrototypeOf = __webpack_require__(3), _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf), _classCallCheck2 = __webpack_require__(29), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _createClass2 = __webpack_require__(30), _createClass3 = _interopRequireDefault(_createClass2), _possibleConstructorReturn2 = __webpack_require__(34), _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2), _inherits2 = __webpack_require__(81), _inherits3 = _interopRequireDefault(_inherits2), _react = __webpack_require__(89), _react2 = _interopRequireDefault(_react), _classnames = __webpack_require__(107), _classnames2 = _interopRequireDefault(_classnames), _createCallbackMemoizer = __webpack_require__(108), _createCallbackMemoizer2 = _interopRequireDefault(_createCallbackMemoizer), _scrollbarSize = __webpack_require__(112), _scrollbarSize2 = _interopRequireDefault(_scrollbarSize), _reactAddonsShallowCompare = __webpack_require__(90), _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare), IS_SCROLLING_TIMEOUT = 150, SCROLL_POSITION_CHANGE_REASONS = {
+ var _extends2 = __webpack_require__(100), _extends3 = _interopRequireDefault(_extends2), _getPrototypeOf = __webpack_require__(3), _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf), _classCallCheck2 = __webpack_require__(29), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _createClass2 = __webpack_require__(30), _createClass3 = _interopRequireDefault(_createClass2), _possibleConstructorReturn2 = __webpack_require__(34), _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2), _inherits2 = __webpack_require__(81), _inherits3 = _interopRequireDefault(_inherits2), _react = __webpack_require__(89), _react2 = _interopRequireDefault(_react), _classnames = __webpack_require__(107), _classnames2 = _interopRequireDefault(_classnames), _createCallbackMemoizer = __webpack_require__(108), _createCallbackMemoizer2 = _interopRequireDefault(_createCallbackMemoizer), _scrollbarSize = __webpack_require__(112), _scrollbarSize2 = _interopRequireDefault(_scrollbarSize), IS_SCROLLING_TIMEOUT = 150, SCROLL_POSITION_CHANGE_REASONS = {
OBSERVED: "observed",
REQUESTED: "requested"
- }, CollectionView = function(_Component) {
+ }, CollectionView = function(_PureComponent) {
function CollectionView(props, context) {
(0, _classCallCheck3.default)(this, CollectionView);
var _this = (0, _possibleConstructorReturn3.default)(this, (CollectionView.__proto__ || (0,
_getPrototypeOf2.default)(CollectionView)).call(this, props, context));
return _this.state = {
- calculateSizeAndPositionDataOnNextUpdate: !1,
isScrolling: !1,
scrollLeft: 0,
scrollTop: 0
- }, _this._onSectionRenderedMemoizer = (0, _createCallbackMemoizer2.default)(), _this._onScrollMemoizer = (0,
- _createCallbackMemoizer2.default)(!1), _this._invokeOnSectionRenderedHelper = _this._invokeOnSectionRenderedHelper.bind(_this),
- _this._onScroll = _this._onScroll.bind(_this), _this._updateScrollPositionForScrollToCell = _this._updateScrollPositionForScrollToCell.bind(_this),
+ }, _this._calculateSizeAndPositionDataOnNextUpdate = !1, _this._onSectionRenderedMemoizer = (0,
+ _createCallbackMemoizer2.default)(), _this._onScrollMemoizer = (0, _createCallbackMemoizer2.default)(!1),
+ _this._invokeOnSectionRenderedHelper = _this._invokeOnSectionRenderedHelper.bind(_this),
+ _this._onScroll = _this._onScroll.bind(_this), _this._setScrollingContainerRef = _this._setScrollingContainerRef.bind(_this),
+ _this._updateScrollPositionForScrollToCell = _this._updateScrollPositionForScrollToCell.bind(_this),
_this;
}
- return (0, _inherits3.default)(CollectionView, _Component), (0, _createClass3.default)(CollectionView, [ {
+ return (0, _inherits3.default)(CollectionView, _PureComponent), (0, _createClass3.default)(CollectionView, [ {
key: "recomputeCellSizesAndPositions",
value: function() {
- this.setState({
- calculateSizeAndPositionDataOnNextUpdate: !0
- });
+ this._calculateSizeAndPositionDataOnNextUpdate = !0, this.forceUpdate();
}
}, {
key: "componentDidMount",
value: function() {
var _props = this.props, cellLayoutManager = _props.cellLayoutManager, scrollLeft = _props.scrollLeft, scrollToCell = _props.scrollToCell, scrollTop = _props.scrollTop;
this._scrollbarSizeMeasured || (this._scrollbarSize = (0, _scrollbarSize2.default)(),
this._scrollbarSizeMeasured = !0, this.setState({})), scrollToCell >= 0 ? this._updateScrollPositionForScrollToCell() : (scrollLeft >= 0 || scrollTop >= 0) && this._setScrollPosition({
scrollLeft: scrollLeft,
@@ -2020,53 +2106,50 @@ var REACT_SHALLOW_COMPARE = "devtools/cl
void 0 === this._scrollbarSize ? (this._scrollbarSizeMeasured = !1, this._scrollbarSize = 0) : this._scrollbarSizeMeasured = !0;
}
}, {
key: "componentWillUnmount",
value: function() {
this._disablePointerEventsTimeoutId && clearTimeout(this._disablePointerEventsTimeoutId);
}
}, {
- key: "componentWillUpdate",
- value: function(nextProps, nextState) {
- 0 !== nextProps.cellCount || 0 === nextState.scrollLeft && 0 === nextState.scrollTop ? nextProps.scrollLeft === this.props.scrollLeft && nextProps.scrollTop === this.props.scrollTop || this._setScrollPosition({
+ key: "componentWillReceiveProps",
+ value: function(nextProps) {
+ var _state2 = this.state, scrollLeft = _state2.scrollLeft, scrollTop = _state2.scrollTop;
+ 0 !== nextProps.cellCount || 0 === scrollLeft && 0 === scrollTop ? nextProps.scrollLeft === this.props.scrollLeft && nextProps.scrollTop === this.props.scrollTop || this._setScrollPosition({
scrollLeft: nextProps.scrollLeft,
scrollTop: nextProps.scrollTop
}) : this._setScrollPosition({
scrollLeft: 0,
scrollTop: 0
- }), (nextProps.cellCount !== this.props.cellCount || nextProps.cellLayoutManager !== this.props.cellLayoutManager || nextState.calculateSizeAndPositionDataOnNextUpdate) && nextProps.cellLayoutManager.calculateSizeAndPositionData(),
- nextState.calculateSizeAndPositionDataOnNextUpdate && this.setState({
- calculateSizeAndPositionDataOnNextUpdate: !1
- });
+ }), (nextProps.cellCount !== this.props.cellCount || nextProps.cellLayoutManager !== this.props.cellLayoutManager || this._calculateSizeAndPositionDataOnNextUpdate) && nextProps.cellLayoutManager.calculateSizeAndPositionData(),
+ this._calculateSizeAndPositionDataOnNextUpdate && (this._calculateSizeAndPositionDataOnNextUpdate = !1);
}
}, {
key: "render",
value: function() {
- var _this2 = this, _props3 = this.props, autoHeight = _props3.autoHeight, cellCount = _props3.cellCount, cellLayoutManager = _props3.cellLayoutManager, className = _props3.className, height = _props3.height, horizontalOverscanSize = _props3.horizontalOverscanSize, id = _props3.id, noContentRenderer = _props3.noContentRenderer, style = _props3.style, verticalOverscanSize = _props3.verticalOverscanSize, width = _props3.width, _state2 = this.state, isScrolling = _state2.isScrolling, scrollLeft = _state2.scrollLeft, scrollTop = _state2.scrollTop, _cellLayoutManager$ge2 = cellLayoutManager.getTotalSize(), totalHeight = _cellLayoutManager$ge2.height, totalWidth = _cellLayoutManager$ge2.width, left = Math.max(0, scrollLeft - horizontalOverscanSize), top = Math.max(0, scrollTop - verticalOverscanSize), right = Math.min(totalWidth, scrollLeft + width + horizontalOverscanSize), bottom = Math.min(totalHeight, scrollTop + height + verticalOverscanSize), childrenToDisplay = height > 0 && width > 0 ? cellLayoutManager.cellRenderers({
+ var _props3 = this.props, autoHeight = _props3.autoHeight, cellCount = _props3.cellCount, cellLayoutManager = _props3.cellLayoutManager, className = _props3.className, height = _props3.height, horizontalOverscanSize = _props3.horizontalOverscanSize, id = _props3.id, noContentRenderer = _props3.noContentRenderer, style = _props3.style, verticalOverscanSize = _props3.verticalOverscanSize, width = _props3.width, _state3 = this.state, isScrolling = _state3.isScrolling, scrollLeft = _state3.scrollLeft, scrollTop = _state3.scrollTop, _cellLayoutManager$ge2 = cellLayoutManager.getTotalSize(), totalHeight = _cellLayoutManager$ge2.height, totalWidth = _cellLayoutManager$ge2.width, left = Math.max(0, scrollLeft - horizontalOverscanSize), top = Math.max(0, scrollTop - verticalOverscanSize), right = Math.min(totalWidth, scrollLeft + width + horizontalOverscanSize), bottom = Math.min(totalHeight, scrollTop + height + verticalOverscanSize), childrenToDisplay = height > 0 && width > 0 ? cellLayoutManager.cellRenderers({
height: bottom - top,
isScrolling: isScrolling,
width: right - left,
x: left,
y: top
}) : [], collectionStyle = {
boxSizing: "border-box",
+ direction: "ltr",
height: autoHeight ? "auto" : height,
- overflow: "auto",
position: "relative",
WebkitOverflowScrolling: "touch",
width: width,
willChange: "transform"
}, verticalScrollBarSize = totalHeight > height ? this._scrollbarSize : 0, horizontalScrollBarSize = totalWidth > width ? this._scrollbarSize : 0;
- return totalWidth + verticalScrollBarSize <= width && (collectionStyle.overflowX = "hidden"),
- totalHeight + horizontalScrollBarSize <= height && (collectionStyle.overflowY = "hidden"),
+ return collectionStyle.overflowX = totalWidth + verticalScrollBarSize <= width ? "hidden" : "auto",
+ collectionStyle.overflowY = totalHeight + horizontalScrollBarSize <= height ? "hidden" : "auto",
_react2.default.createElement("div", {
- ref: function(_ref) {
- _this2._scrollingContainer = _ref;
- },
+ ref: this._setScrollingContainerRef,
"aria-label": this.props["aria-label"],
className: (0, _classnames2.default)("ReactVirtualized__Collection", className),
id: id,
onScroll: this._onScroll,
role: "grid",
style: (0, _extends3.default)({}, collectionStyle, style),
tabIndex: 0
}, cellCount > 0 && _react2.default.createElement("div", {
@@ -2077,28 +2160,23 @@ var REACT_SHALLOW_COMPARE = "devtools/cl
maxWidth: totalWidth,
overflow: "hidden",
pointerEvents: isScrolling ? "none" : "",
width: totalWidth
}
}, childrenToDisplay), 0 === cellCount && noContentRenderer());
}
}, {
- key: "shouldComponentUpdate",
- value: function(nextProps, nextState) {
- return (0, _reactAddonsShallowCompare2.default)(this, nextProps, nextState);
- }
- }, {
key: "_enablePointerEventsAfterDelay",
value: function() {
- var _this3 = this;
+ var _this2 = this;
this._disablePointerEventsTimeoutId && clearTimeout(this._disablePointerEventsTimeoutId),
this._disablePointerEventsTimeoutId = setTimeout(function() {
- var isScrollingChange = _this3.props.isScrollingChange;
- isScrollingChange(!1), _this3._disablePointerEventsTimeoutId = null, _this3.setState({
+ var isScrollingChange = _this2.props.isScrollingChange;
+ isScrollingChange(!1), _this2._disablePointerEventsTimeoutId = null, _this2.setState({
isScrolling: !1
});
}, IS_SCROLLING_TIMEOUT);
}
}, {
key: "_invokeOnSectionRenderedHelper",
value: function() {
var _props4 = this.props, cellLayoutManager = _props4.cellLayoutManager, onSectionRendered = _props4.onSectionRendered;
@@ -2106,49 +2184,54 @@ var REACT_SHALLOW_COMPARE = "devtools/cl
callback: onSectionRendered,
indices: {
indices: cellLayoutManager.getLastRenderedIndices()
}
});
}
}, {
key: "_invokeOnScrollMemoizer",
- value: function(_ref2) {
- var _this4 = this, scrollLeft = _ref2.scrollLeft, scrollTop = _ref2.scrollTop, totalHeight = _ref2.totalHeight, totalWidth = _ref2.totalWidth;
+ value: function(_ref) {
+ var _this3 = this, scrollLeft = _ref.scrollLeft, scrollTop = _ref.scrollTop, totalHeight = _ref.totalHeight, totalWidth = _ref.totalWidth;
this._onScrollMemoizer({
- callback: function(_ref3) {
- var scrollLeft = _ref3.scrollLeft, scrollTop = _ref3.scrollTop, _props5 = _this4.props, height = _props5.height, onScroll = _props5.onScroll, width = _props5.width;
+ callback: function(_ref2) {
+ var scrollLeft = _ref2.scrollLeft, scrollTop = _ref2.scrollTop, _props5 = _this3.props, height = _props5.height, onScroll = _props5.onScroll, width = _props5.width;
onScroll({
clientHeight: height,
clientWidth: width,
scrollHeight: totalHeight,
scrollLeft: scrollLeft,
scrollTop: scrollTop,
scrollWidth: totalWidth
});
},
indices: {
scrollLeft: scrollLeft,
scrollTop: scrollTop
}
});
}
}, {
+ key: "_setScrollingContainerRef",
+ value: function(ref) {
+ this._scrollingContainer = ref;
+ }
+ }, {
key: "_setScrollPosition",
- value: function(_ref4) {
- var scrollLeft = _ref4.scrollLeft, scrollTop = _ref4.scrollTop, newState = {
+ value: function(_ref3) {
+ var scrollLeft = _ref3.scrollLeft, scrollTop = _ref3.scrollTop, newState = {
scrollPositionChangeReason: SCROLL_POSITION_CHANGE_REASONS.REQUESTED
};
scrollLeft >= 0 && (newState.scrollLeft = scrollLeft), scrollTop >= 0 && (newState.scrollTop = scrollTop),
(scrollLeft >= 0 && scrollLeft !== this.state.scrollLeft || scrollTop >= 0 && scrollTop !== this.state.scrollTop) && this.setState(newState);
}
}, {
key: "_updateScrollPositionForScrollToCell",
value: function() {
- var _props6 = this.props, cellLayoutManager = _props6.cellLayoutManager, height = _props6.height, scrollToAlignment = _props6.scrollToAlignment, scrollToCell = _props6.scrollToCell, width = _props6.width, _state3 = this.state, scrollLeft = _state3.scrollLeft, scrollTop = _state3.scrollTop;
+ var _props6 = this.props, cellLayoutManager = _props6.cellLayoutManager, height = _props6.height, scrollToAlignment = _props6.scrollToAlignment, scrollToCell = _props6.scrollToCell, width = _props6.width, _state4 = this.state, scrollLeft = _state4.scrollLeft, scrollTop = _state4.scrollTop;
if (scrollToCell >= 0) {
var scrollPosition = cellLayoutManager.getScrollPositionForCell({
align: scrollToAlignment,
cellIndex: scrollToCell,
height: height,
scrollLeft: scrollLeft,
scrollTop: scrollTop,
width: width
@@ -2175,30 +2258,31 @@ var REACT_SHALLOW_COMPARE = "devtools/cl
scrollLeft: scrollLeft,
scrollTop: scrollTop,
totalWidth: totalWidth,
totalHeight: totalHeight
});
}
}
} ]), CollectionView;
- }(_react.Component);
+ }(_react.PureComponent);
CollectionView.defaultProps = {
"aria-label": "grid",
horizontalOverscanSize: 0,
noContentRenderer: function() {
return null;
},
onScroll: function() {
return null;
},
onSectionRendered: function() {
return null;
},
scrollToAlignment: "auto",
+ scrollToCell: -1,
style: {},
verticalOverscanSize: 0
}, exports.default = CollectionView;
}, /* 107 */
/***/
function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
/*!
@@ -2273,31 +2357,42 @@ var REACT_SHALLOW_COMPARE = "devtools/cl
return function(it) {
return $keys(toObject(it));
};
});
}, /* 112 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
- var size, canUseDOM = __webpack_require__(113);
- module.exports = function(recalc) {
- if ((!size || recalc) && canUseDOM) {
- var scrollDiv = document.createElementNS("http://www.w3.org/1999/xhtml","div");
+ function _interopRequireDefault(obj) {
+ return obj && obj.__esModule ? obj : {
+ default: obj
+ };
+ }
+ Object.defineProperty(exports, "__esModule", {
+ value: !0
+ }), exports.default = function(recalc) {
+ if ((!size || recalc) && _inDOM2.default) {
+ var scrollDiv = document.createElement("div");
scrollDiv.style.position = "absolute", scrollDiv.style.top = "-9999px", scrollDiv.style.width = "50px",
- scrollDiv.style.height = "50px", scrollDiv.style.overflow = "scroll", document.firstElementChild.appendChild(scrollDiv),
- size = scrollDiv.offsetWidth - scrollDiv.clientWidth, document.firstElementChild.removeChild(scrollDiv);
+ scrollDiv.style.height = "50px", scrollDiv.style.overflow = "scroll", document.body.appendChild(scrollDiv),
+ size = scrollDiv.offsetWidth - scrollDiv.clientWidth, document.body.removeChild(scrollDiv);
}
return size;
};
+ var _inDOM = __webpack_require__(113), _inDOM2 = _interopRequireDefault(_inDOM), size = void 0;
+ module.exports = exports.default;
}, /* 113 */
/***/
function(module, exports) {
"use strict";
- module.exports = !("undefined" == typeof window || !window.document || !window.document.createElement);
+ Object.defineProperty(exports, "__esModule", {
+ value: !0
+ }), exports.default = !("undefined" == typeof window || !window.document || !window.document.createElement),
+ module.exports = exports.default;
}, /* 114 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
@@ -2487,24 +2582,24 @@ var REACT_SHALLOW_COMPARE = "devtools/cl
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
Object.defineProperty(exports, "__esModule", {
value: !0
});
- var _getPrototypeOf = __webpack_require__(3), _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf), _classCallCheck2 = __webpack_require__(29), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _createClass2 = __webpack_require__(30), _createClass3 = _interopRequireDefault(_createClass2), _possibleConstructorReturn2 = __webpack_require__(34), _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2), _inherits2 = __webpack_require__(81), _inherits3 = _interopRequireDefault(_inherits2), _react = __webpack_require__(89), _reactAddonsShallowCompare = __webpack_require__(90), _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare), _Grid = __webpack_require__(120), _Grid2 = _interopRequireDefault(_Grid), ColumnSizer = function(_Component) {
+ var _getPrototypeOf = __webpack_require__(3), _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf), _classCallCheck2 = __webpack_require__(29), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _createClass2 = __webpack_require__(30), _createClass3 = _interopRequireDefault(_createClass2), _possibleConstructorReturn2 = __webpack_require__(34), _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2), _inherits2 = __webpack_require__(81), _inherits3 = _interopRequireDefault(_inherits2), _react = __webpack_require__(89), ColumnSizer = function(_PureComponent) {
function ColumnSizer(props, context) {
(0, _classCallCheck3.default)(this, ColumnSizer);
var _this = (0, _possibleConstructorReturn3.default)(this, (ColumnSizer.__proto__ || (0,
_getPrototypeOf2.default)(ColumnSizer)).call(this, props, context));
return _this._registerChild = _this._registerChild.bind(_this), _this;
}
- return (0, _inherits3.default)(ColumnSizer, _Component), (0, _createClass3.default)(ColumnSizer, [ {
+ return (0, _inherits3.default)(ColumnSizer, _PureComponent), (0, _createClass3.default)(ColumnSizer, [ {
key: "componentDidUpdate",
value: function(prevProps, prevState) {
var _props = this.props, columnMaxWidth = _props.columnMaxWidth, columnMinWidth = _props.columnMinWidth, columnCount = _props.columnCount, width = _props.width;
columnMaxWidth === prevProps.columnMaxWidth && columnMinWidth === prevProps.columnMinWidth && columnCount === prevProps.columnCount && width === prevProps.width || this._registeredChild && this._registeredChild.recomputeGridSize();
}
}, {
key: "render",
value: function() {
@@ -2516,242 +2611,698 @@ var REACT_SHALLOW_COMPARE = "devtools/cl
adjustedWidth: adjustedWidth,
getColumnWidth: function() {
return columnWidth;
},
registerChild: this._registerChild
});
}
}, {
- key: "shouldComponentUpdate",
- value: function(nextProps, nextState) {
- return (0, _reactAddonsShallowCompare2.default)(this, nextProps, nextState);
- }
- }, {
key: "_registerChild",
value: function(child) {
- if (null !== child && !(child instanceof _Grid2.default)) throw Error("Unexpected child type registered; only Grid children are supported.");
+ if (child && "function" != typeof child.recomputeGridSize) throw Error("Unexpected child type registered; only Grid/MultiGrid children are supported.");
this._registeredChild = child, this._registeredChild && this._registeredChild.recomputeGridSize();
}
} ]), ColumnSizer;
- }(_react.Component);
+ }(_react.PureComponent);
exports.default = ColumnSizer;
}, /* 120 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
Object.defineProperty(exports, "__esModule", {
value: !0
+ }), exports.SortIndicator = exports.SortDirection = exports.Column = exports.Table = exports.defaultRowRenderer = exports.defaultHeaderRenderer = exports.defaultCellRenderer = exports.defaultCellDataGetter = exports.default = void 0;
+ var _Table2 = __webpack_require__(121), _Table3 = _interopRequireDefault(_Table2), _defaultCellDataGetter2 = __webpack_require__(127), _defaultCellDataGetter3 = _interopRequireDefault(_defaultCellDataGetter2), _defaultCellRenderer2 = __webpack_require__(126), _defaultCellRenderer3 = _interopRequireDefault(_defaultCellRenderer2), _defaultHeaderRenderer2 = __webpack_require__(123), _defaultHeaderRenderer3 = _interopRequireDefault(_defaultHeaderRenderer2), _defaultRowRenderer2 = __webpack_require__(136), _defaultRowRenderer3 = _interopRequireDefault(_defaultRowRenderer2), _Column2 = __webpack_require__(122), _Column3 = _interopRequireDefault(_Column2), _SortDirection2 = __webpack_require__(125), _SortDirection3 = _interopRequireDefault(_SortDirection2), _SortIndicator2 = __webpack_require__(124), _SortIndicator3 = _interopRequireDefault(_SortIndicator2);
+ exports.default = _Table3.default, exports.defaultCellDataGetter = _defaultCellDataGetter3.default,
+ exports.defaultCellRenderer = _defaultCellRenderer3.default, exports.defaultHeaderRenderer = _defaultHeaderRenderer3.default,
+ exports.defaultRowRenderer = _defaultRowRenderer3.default, exports.Table = _Table3.default,
+ exports.Column = _Column3.default, exports.SortDirection = _SortDirection3.default,
+ exports.SortIndicator = _SortIndicator3.default;
+ }, /* 121 */
+ /***/
+ function(module, exports, __webpack_require__) {
+ "use strict";
+ function _interopRequireDefault(obj) {
+ return obj && obj.__esModule ? obj : {
+ default: obj
+ };
+ }
+ Object.defineProperty(exports, "__esModule", {
+ value: !0
+ });
+ var _extends2 = __webpack_require__(100), _extends3 = _interopRequireDefault(_extends2), _getPrototypeOf = __webpack_require__(3), _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf), _classCallCheck2 = __webpack_require__(29), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _createClass2 = __webpack_require__(30), _createClass3 = _interopRequireDefault(_createClass2), _possibleConstructorReturn2 = __webpack_require__(34), _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2), _inherits2 = __webpack_require__(81), _inherits3 = _interopRequireDefault(_inherits2), _classnames = __webpack_require__(107), _classnames2 = _interopRequireDefault(_classnames), _Column = __webpack_require__(122), _react = (_interopRequireDefault(_Column),
+ __webpack_require__(89)), _react2 = _interopRequireDefault(_react), _reactDom = __webpack_require__(96), _Grid = __webpack_require__(128), _Grid2 = _interopRequireDefault(_Grid), _defaultRowRenderer = __webpack_require__(136), _defaultRowRenderer2 = _interopRequireDefault(_defaultRowRenderer), _SortDirection = __webpack_require__(125), _SortDirection2 = _interopRequireDefault(_SortDirection), Table = function(_PureComponent) {
+ function Table(props) {
+ (0, _classCallCheck3.default)(this, Table);
+ var _this = (0, _possibleConstructorReturn3.default)(this, (Table.__proto__ || (0,
+ _getPrototypeOf2.default)(Table)).call(this, props));
+ return _this.state = {
+ scrollbarWidth: 0
+ }, _this._createColumn = _this._createColumn.bind(_this), _this._createRow = _this._createRow.bind(_this),
+ _this._onScroll = _this._onScroll.bind(_this), _this._onSectionRendered = _this._onSectionRendered.bind(_this),
+ _this._setRef = _this._setRef.bind(_this), _this;
+ }
+ return (0, _inherits3.default)(Table, _PureComponent), (0, _createClass3.default)(Table, [ {
+ key: "forceUpdateGrid",
+ value: function() {
+ this.Grid.forceUpdate();
+ }
+ }, {
+ key: "measureAllRows",
+ value: function() {
+ this.Grid.measureAllCells();
+ }
+ }, {
+ key: "recomputeRowHeights",
+ value: function() {
+ var index = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0;
+ this.Grid.recomputeGridSize({
+ rowIndex: index
+ });
+ }
+ }, {
+ key: "scrollToRow",
+ value: function() {
+ var index = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0;
+ this.Grid.scrollToCell({
+ columnIndex: 0,
+ rowIndex: index
+ });
+ }
+ }, {
+ key: "componentDidMount",
+ value: function() {
+ this._setScrollbarWidth();
+ }
+ }, {
+ key: "componentDidUpdate",
+ value: function() {
+ this._setScrollbarWidth();
+ }
+ }, {
+ key: "render",
+ value: function() {
+ var _this2 = this, _props = this.props, children = _props.children, className = _props.className, disableHeader = _props.disableHeader, gridClassName = _props.gridClassName, gridStyle = _props.gridStyle, headerHeight = _props.headerHeight, height = _props.height, id = _props.id, noRowsRenderer = _props.noRowsRenderer, rowClassName = _props.rowClassName, rowStyle = _props.rowStyle, scrollToIndex = _props.scrollToIndex, style = _props.style, width = _props.width, scrollbarWidth = this.state.scrollbarWidth, availableRowsHeight = disableHeader ? height : height - headerHeight, rowClass = "function" == typeof rowClassName ? rowClassName({
+ index: -1
+ }) : rowClassName, rowStyleObject = "function" == typeof rowStyle ? rowStyle({
+ index: -1
+ }) : rowStyle;
+ return this._cachedColumnStyles = [], _react2.default.Children.toArray(children).forEach(function(column, index) {
+ var flexStyles = _this2._getFlexStyleForColumn(column, column.props.style);
+ _this2._cachedColumnStyles[index] = (0, _extends3.default)({}, flexStyles, {
+ overflow: "hidden"
+ });
+ }), _react2.default.createElement("div", {
+ className: (0, _classnames2.default)("ReactVirtualized__Table", className),
+ id: id,
+ style: style
+ }, !disableHeader && _react2.default.createElement("div", {
+ className: (0, _classnames2.default)("ReactVirtualized__Table__headerRow", rowClass),
+ style: (0, _extends3.default)({}, rowStyleObject, {
+ height: headerHeight,
+ overflow: "hidden",
+ paddingRight: scrollbarWidth,
+ width: width
+ })
+ }, this._getRenderedHeaderRow()), _react2.default.createElement(_Grid2.default, (0,
+ _extends3.default)({}, this.props, {
+ autoContainerWidth: !0,
+ className: (0, _classnames2.default)("ReactVirtualized__Table__Grid", gridClassName),
+ cellRenderer: this._createRow,
+ columnWidth: width,
+ columnCount: 1,
+ height: availableRowsHeight,
+ id: void 0,
+ noContentRenderer: noRowsRenderer,
+ onScroll: this._onScroll,
+ onSectionRendered: this._onSectionRendered,
+ ref: this._setRef,
+ scrollbarWidth: scrollbarWidth,
+ scrollToRow: scrollToIndex,
+ style: (0, _extends3.default)({}, gridStyle, {
+ overflowX: "hidden"
+ })
+ })));
+ }
+ }, {
+ key: "_createColumn",
+ value: function(_ref) {
+ var column = _ref.column, columnIndex = _ref.columnIndex, isScrolling = _ref.isScrolling, parent = _ref.parent, rowData = _ref.rowData, rowIndex = _ref.rowIndex, _column$props = column.props, cellDataGetter = _column$props.cellDataGetter, cellRenderer = _column$props.cellRenderer, className = _column$props.className, columnData = _column$props.columnData, dataKey = _column$props.dataKey, cellData = cellDataGetter({
+ columnData: columnData,
+ dataKey: dataKey,
+ rowData: rowData
+ }), renderedCell = cellRenderer({
+ cellData: cellData,
+ columnData: columnData,
+ dataKey: dataKey,
+ isScrolling: isScrolling,
+ parent: parent,
+ rowData: rowData,
+ rowIndex: rowIndex
+ }), style = this._cachedColumnStyles[columnIndex], title = "string" == typeof renderedCell ? renderedCell : null;
+ return _react2.default.createElement("div", {
+ key: "Row" + rowIndex + "-Col" + columnIndex,
+ className: (0, _classnames2.default)("ReactVirtualized__Table__rowColumn", className),
+ style: style,
+ title: title
+ }, renderedCell);
+ }
+ }, {
+ key: "_createHeader",
+ value: function(_ref2) {
+ var column = _ref2.column, index = _ref2.index, _props2 = this.props, headerClassName = _props2.headerClassName, headerStyle = _props2.headerStyle, onHeaderClick = _props2.onHeaderClick, sort = _props2.sort, sortBy = _props2.sortBy, sortDirection = _props2.sortDirection, _column$props2 = column.props, dataKey = _column$props2.dataKey, disableSort = _column$props2.disableSort, headerRenderer = _column$props2.headerRenderer, label = _column$props2.label, columnData = _column$props2.columnData, sortEnabled = !disableSort && sort, classNames = (0,
+ _classnames2.default)("ReactVirtualized__Table__headerColumn", headerClassName, column.props.headerClassName, {
+ ReactVirtualized__Table__sortableHeaderColumn: sortEnabled
+ }), style = this._getFlexStyleForColumn(column, headerStyle), renderedHeader = headerRenderer({
+ columnData: columnData,
+ dataKey: dataKey,
+ disableSort: disableSort,
+ label: label,
+ sortBy: sortBy,
+ sortDirection: sortDirection
+ }), a11yProps = {};
+ return (sortEnabled || onHeaderClick) && !function() {
+ var newSortDirection = sortBy !== dataKey || sortDirection === _SortDirection2.default.DESC ? _SortDirection2.default.ASC : _SortDirection2.default.DESC, onClick = function() {
+ sortEnabled && sort({
+ sortBy: dataKey,
+ sortDirection: newSortDirection
+ }), onHeaderClick && onHeaderClick({
+ columnData: columnData,
+ dataKey: dataKey
+ });
+ }, onKeyDown = function(event) {
+ "Enter" !== event.key && " " !== event.key || onClick();
+ };
+ a11yProps["aria-label"] = column.props["aria-label"] || label || dataKey, a11yProps.role = "rowheader",
+ a11yProps.tabIndex = 0, a11yProps.onClick = onClick, a11yProps.onKeyDown = onKeyDown;
+ }(), _react2.default.createElement("div", (0, _extends3.default)({}, a11yProps, {
+ key: "Header-Col" + index,
+ className: classNames,
+ style: style
+ }), renderedHeader);
+ }
+ }, {
+ key: "_createRow",
+ value: function(_ref3) {
+ var _this3 = this, index = _ref3.rowIndex, isScrolling = _ref3.isScrolling, key = _ref3.key, parent = _ref3.parent, style = _ref3.style, _props3 = this.props, children = _props3.children, onRowClick = _props3.onRowClick, onRowDoubleClick = _props3.onRowDoubleClick, onRowMouseOver = _props3.onRowMouseOver, onRowMouseOut = _props3.onRowMouseOut, rowClassName = _props3.rowClassName, rowGetter = _props3.rowGetter, rowRenderer = _props3.rowRenderer, rowStyle = _props3.rowStyle, scrollbarWidth = this.state.scrollbarWidth, rowClass = "function" == typeof rowClassName ? rowClassName({
+ index: index
+ }) : rowClassName, rowStyleObject = "function" == typeof rowStyle ? rowStyle({
+ index: index
+ }) : rowStyle, rowData = rowGetter({
+ index: index
+ }), columns = _react2.default.Children.toArray(children).map(function(column, columnIndex) {
+ return _this3._createColumn({
+ column: column,
+ columnIndex: columnIndex,
+ isScrolling: isScrolling,
+ parent: parent,
+ rowData: rowData,
+ rowIndex: index,
+ scrollbarWidth: scrollbarWidth
+ });
+ }), className = (0, _classnames2.default)("ReactVirtualized__Table__row", rowClass), flattenedStyle = (0,
+ _extends3.default)({}, style, rowStyleObject, {
+ height: this._getRowHeight(index),
+ overflow: "hidden",
+ paddingRight: scrollbarWidth
+ });
+ return rowRenderer({
+ className: className,
+ columns: columns,
+ index: index,
+ isScrolling: isScrolling,
+ key: key,
+ onRowClick: onRowClick,
+ onRowDoubleClick: onRowDoubleClick,
+ onRowMouseOver: onRowMouseOver,
+ onRowMouseOut: onRowMouseOut,
+ rowData: rowData,
+ style: flattenedStyle
+ });
+ }
+ }, {
+ key: "_getFlexStyleForColumn",
+ value: function(column) {
+ var customStyle = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, flexValue = column.props.flexGrow + " " + column.props.flexShrink + " " + column.props.width + "px", style = (0,
+ _extends3.default)({}, customStyle, {
+ flex: flexValue,
+ msFlex: flexValue,
+ WebkitFlex: flexValue
+ });
+ return column.props.maxWidth && (style.maxWidth = column.props.maxWidth), column.props.minWidth && (style.minWidth = column.props.minWidth),
+ style;
+ }
+ }, {
+ key: "_getRenderedHeaderRow",
+ value: function() {
+ var _this4 = this, _props4 = this.props, children = _props4.children, disableHeader = _props4.disableHeader, items = disableHeader ? [] : _react2.default.Children.toArray(children);
+ return items.map(function(column, index) {
+ return _this4._createHeader({
+ column: column,
+ index: index
+ });
+ });
+ }
+ }, {
+ key: "_getRowHeight",
+ value: function(rowIndex) {
+ var rowHeight = this.props.rowHeight;
+ return "function" == typeof rowHeight ? rowHeight({
+ index: rowIndex
+ }) : rowHeight;
+ }
+ }, {
+ key: "_onScroll",
+ value: function(_ref4) {
+ var clientHeight = _ref4.clientHeight, scrollHeight = _ref4.scrollHeight, scrollTop = _ref4.scrollTop, onScroll = this.props.onScroll;
+ onScroll({
+ clientHeight: clientHeight,
+ scrollHeight: scrollHeight,
+ scrollTop: scrollTop
+ });
+ }
+ }, {
+ key: "_onSectionRendered",
+ value: function(_ref5) {
+ var rowOverscanStartIndex = _ref5.rowOverscanStartIndex, rowOverscanStopIndex = _ref5.rowOverscanStopIndex, rowStartIndex = _ref5.rowStartIndex, rowStopIndex = _ref5.rowStopIndex, onRowsRendered = this.props.onRowsRendered;
+ onRowsRendered({
+ overscanStartIndex: rowOverscanStartIndex,
+ overscanStopIndex: rowOverscanStopIndex,
+ startIndex: rowStartIndex,
+ stopIndex: rowStopIndex
+ });
+ }
+ }, {
+ key: "_setRef",
+ value: function(ref) {
+ this.Grid = ref;
+ }
+ }, {
+ key: "_setScrollbarWidth",
+ value: function() {
+ var Grid = (0, _reactDom.findDOMNode)(this.Grid), clientWidth = Grid.clientWidth || 0, offsetWidth = Grid.offsetWidth || 0, scrollbarWidth = offsetWidth - clientWidth;
+ this.setState({
+ scrollbarWidth: scrollbarWidth
+ });
+ }
+ } ]), Table;
+ }(_react.PureComponent);
+ Table.defaultProps = {
+ disableHeader: !1,
+ estimatedRowSize: 30,
+ headerHeight: 0,
+ headerStyle: {},
+ noRowsRenderer: function() {
+ return null;
+ },
+ onRowsRendered: function() {
+ return null;
+ },
+ onScroll: function() {
+ return null;
+ },
+ overscanRowCount: 10,
+ rowRenderer: _defaultRowRenderer2.default,
+ rowStyle: {},
+ scrollToAlignment: "auto",
+ scrollToIndex: -1,
+ style: {}
+ }, exports.default = Table;
+ }, /* 122 */
+ /***/
+ function(module, exports, __webpack_require__) {
+ "use strict";
+ function _interopRequireDefault(obj) {
+ return obj && obj.__esModule ? obj : {
+ default: obj
+ };
+ }
+ Object.defineProperty(exports, "__esModule", {
+ value: !0
+ });
+ var _getPrototypeOf = __webpack_require__(3), _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf), _classCallCheck2 = __webpack_require__(29), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _possibleConstructorReturn2 = __webpack_require__(34), _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2), _inherits2 = __webpack_require__(81), _inherits3 = _interopRequireDefault(_inherits2), _react = __webpack_require__(89), _defaultHeaderRenderer = __webpack_require__(123), _defaultHeaderRenderer2 = _interopRequireDefault(_defaultHeaderRenderer), _defaultCellRenderer = __webpack_require__(126), _defaultCellRenderer2 = _interopRequireDefault(_defaultCellRenderer), _defaultCellDataGetter = __webpack_require__(127), _defaultCellDataGetter2 = _interopRequireDefault(_defaultCellDataGetter), Column = function(_Component) {
+ function Column() {
+ return (0, _classCallCheck3.default)(this, Column), (0, _possibleConstructorReturn3.default)(this, (Column.__proto__ || (0,
+ _getPrototypeOf2.default)(Column)).apply(this, arguments));
+ }
+ return (0, _inherits3.default)(Column, _Component), Column;
+ }(_react.Component);
+ Column.defaultProps = {
+ cellDataGetter: _defaultCellDataGetter2.default,
+ cellRenderer: _defaultCellRenderer2.default,
+ flexGrow: 0,
+ flexShrink: 1,
+ headerRenderer: _defaultHeaderRenderer2.default,
+ style: {}
+ }, exports.default = Column;
+ }, /* 123 */
+ /***/
+ function(module, exports, __webpack_require__) {
+ "use strict";
+ function _interopRequireDefault(obj) {
+ return obj && obj.__esModule ? obj : {
+ default: obj
+ };
+ }
+ function defaultHeaderRenderer(_ref) {
+ var dataKey = (_ref.columnData, _ref.dataKey), label = (_ref.disableSort, _ref.label), sortBy = _ref.sortBy, sortDirection = _ref.sortDirection, showSortIndicator = sortBy === dataKey, children = [ _react2.default.createElement("span", {
+ className: "ReactVirtualized__Table__headerTruncatedText",
+ key: "label",
+ title: label
+ }, label) ];
+ return showSortIndicator && children.push(_react2.default.createElement(_SortIndicator2.default, {
+ key: "SortIndicator",
+ sortDirection: sortDirection
+ })), children;
+ }
+ Object.defineProperty(exports, "__esModule", {
+ value: !0
+ }), exports.default = defaultHeaderRenderer;
+ var _react = __webpack_require__(89), _react2 = _interopRequireDefault(_react), _SortIndicator = __webpack_require__(124), _SortIndicator2 = _interopRequireDefault(_SortIndicator);
+ }, /* 124 */
+ /***/
+ function(module, exports, __webpack_require__) {
+ "use strict";
+ function _interopRequireDefault(obj) {
+ return obj && obj.__esModule ? obj : {
+ default: obj
+ };
+ }
+ function SortIndicator(_ref) {
+ var sortDirection = _ref.sortDirection, classNames = (0, _classnames2.default)("ReactVirtualized__Table__sortableHeaderIcon", {
+ "ReactVirtualized__Table__sortableHeaderIcon--ASC": sortDirection === _SortDirection2.default.ASC,
+ "ReactVirtualized__Table__sortableHeaderIcon--DESC": sortDirection === _SortDirection2.default.DESC
+ });
+ return _react2.default.createElement("svg", {
+ className: classNames,
+ width: 18,
+ height: 18,
+ viewBox: "0 0 24 24"
+ }, sortDirection === _SortDirection2.default.ASC ? _react2.default.createElement("path", {
+ d: "M7 14l5-5 5 5z"
+ }) : _react2.default.createElement("path", {
+ d: "M7 10l5 5 5-5z"
+ }), _react2.default.createElement("path", {
+ d: "M0 0h24v24H0z",
+ fill: "none"
+ }));
+ }
+ Object.defineProperty(exports, "__esModule", {
+ value: !0
+ }), exports.default = SortIndicator;
+ var _react = __webpack_require__(89), _react2 = _interopRequireDefault(_react), _classnames = __webpack_require__(107), _classnames2 = _interopRequireDefault(_classnames), _SortDirection = __webpack_require__(125), _SortDirection2 = _interopRequireDefault(_SortDirection);
+ }, /* 125 */
+ /***/
+ function(module, exports) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", {
+ value: !0
+ });
+ var SortDirection = {
+ ASC: "ASC",
+ DESC: "DESC"
+ };
+ exports.default = SortDirection;
+ }, /* 126 */
+ /***/
+ function(module, exports) {
+ "use strict";
+ function defaultCellRenderer(_ref) {
+ var cellData = _ref.cellData;
+ _ref.cellDataKey, _ref.columnData, _ref.rowData, _ref.rowIndex;
+ return null == cellData ? "" : String(cellData);
+ }
+ Object.defineProperty(exports, "__esModule", {
+ value: !0
+ }), exports.default = defaultCellRenderer;
+ }, /* 127 */
+ /***/
+ function(module, exports) {
+ "use strict";
+ function defaultCellDataGetter(_ref) {
+ var dataKey = (_ref.columnData, _ref.dataKey), rowData = _ref.rowData;
+ return "function" == typeof rowData.get ? rowData.get(dataKey) : rowData[dataKey];
+ }
+ Object.defineProperty(exports, "__esModule", {
+ value: !0
+ }), exports.default = defaultCellDataGetter;
+ }, /* 128 */
+ /***/
+ function(module, exports, __webpack_require__) {
+ "use strict";
+ function _interopRequireDefault(obj) {
+ return obj && obj.__esModule ? obj : {
+ default: obj
+ };
+ }
+ Object.defineProperty(exports, "__esModule", {
+ value: !0
}), exports.defaultCellRangeRenderer = exports.Grid = exports.default = void 0;
- var _Grid2 = __webpack_require__(121), _Grid3 = _interopRequireDefault(_Grid2), _defaultCellRangeRenderer2 = __webpack_require__(127), _defaultCellRangeRenderer3 = _interopRequireDefault(_defaultCellRangeRenderer2);
+ var _Grid2 = __webpack_require__(129), _Grid3 = _interopRequireDefault(_Grid2), _defaultCellRangeRenderer2 = __webpack_require__(135), _defaultCellRangeRenderer3 = _interopRequireDefault(_defaultCellRangeRenderer2);
exports.default = _Grid3.default, exports.Grid = _Grid3.default, exports.defaultCellRangeRenderer = _defaultCellRangeRenderer3.default;
- }, /* 121 */
+ }, /* 129 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
Object.defineProperty(exports, "__esModule", {
value: !0
}), exports.DEFAULT_SCROLLING_RESET_TIME_INTERVAL = void 0;
- var _extends2 = __webpack_require__(100), _extends3 = _interopRequireDefault(_extends2), _getPrototypeOf = __webpack_require__(3), _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf), _classCallCheck2 = __webpack_require__(29), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _createClass2 = __webpack_require__(30), _createClass3 = _interopRequireDefault(_createClass2), _possibleConstructorReturn2 = __webpack_require__(34), _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2), _inherits2 = __webpack_require__(81), _inherits3 = _interopRequireDefault(_inherits2), _react = __webpack_require__(89), _react2 = _interopRequireDefault(_react), _classnames = __webpack_require__(107), _classnames2 = _interopRequireDefault(_classnames), _calculateSizeAndPositionDataAndUpdateScrollOffset = __webpack_require__(122), _calculateSizeAndPositionDataAndUpdateScrollOffset2 = _interopRequireDefault(_calculateSizeAndPositionDataAndUpdateScrollOffset), _ScalingCellSizeAndPositionManager = __webpack_require__(123), _ScalingCellSizeAndPositionManager2 = _interopRequireDefault(_ScalingCellSizeAndPositionManager), _createCallbackMemoizer = __webpack_require__(108), _createCallbackMemoizer2 = _interopRequireDefault(_createCallbackMemoizer), _getOverscanIndices = __webpack_require__(125), _getOverscanIndices2 = _interopRequireDefault(_getOverscanIndices), _scrollbarSize = __webpack_require__(112), _scrollbarSize2 = _interopRequireDefault(_scrollbarSize), _reactAddonsShallowCompare = __webpack_require__(90), _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare), _updateScrollIndexHelper = __webpack_require__(126), _updateScrollIndexHelper2 = _interopRequireDefault(_updateScrollIndexHelper), _defaultCellRangeRenderer = __webpack_require__(127), _defaultCellRangeRenderer2 = _interopRequireDefault(_defaultCellRangeRenderer), DEFAULT_SCROLLING_RESET_TIME_INTERVAL = exports.DEFAULT_SCROLLING_RESET_TIME_INTERVAL = 150, SCROLL_POSITION_CHANGE_REASONS = {
+ var _extends2 = __webpack_require__(100), _extends3 = _interopRequireDefault(_extends2), _getPrototypeOf = __webpack_require__(3), _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf), _classCallCheck2 = __webpack_require__(29), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _createClass2 = __webpack_require__(30), _createClass3 = _interopRequireDefault(_createClass2), _possibleConstructorReturn2 = __webpack_require__(34), _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2), _inherits2 = __webpack_require__(81), _inherits3 = _interopRequireDefault(_inherits2), _react = __webpack_require__(89), _react2 = _interopRequireDefault(_react), _classnames = __webpack_require__(107), _classnames2 = _interopRequireDefault(_classnames), _calculateSizeAndPositionDataAndUpdateScrollOffset = __webpack_require__(130), _calculateSizeAndPositionDataAndUpdateScrollOffset2 = _interopRequireDefault(_calculateSizeAndPositionDataAndUpdateScrollOffset), _ScalingCellSizeAndPositionManager = __webpack_require__(131), _ScalingCellSizeAndPositionManager2 = _interopRequireDefault(_ScalingCellSizeAndPositionManager), _createCallbackMemoizer = __webpack_require__(108), _createCallbackMemoizer2 = _interopRequireDefault(_createCallbackMemoizer), _defaultOverscanIndicesGetter = __webpack_require__(133), _defaultOverscanIndicesGetter2 = _interopRequireDefault(_defaultOverscanIndicesGetter), _updateScrollIndexHelper = __webpack_require__(134), _updateScrollIndexHelper2 = _interopRequireDefault(_updateScrollIndexHelper), _defaultCellRangeRenderer = __webpack_require__(135), _defaultCellRangeRenderer2 = _interopRequireDefault(_defaultCellRangeRenderer), DEFAULT_SCROLLING_RESET_TIME_INTERVAL = exports.DEFAULT_SCROLLING_RESET_TIME_INTERVAL = 150, SCROLL_POSITION_CHANGE_REASONS = {
OBSERVED: "observed",
REQUESTED: "requested"
- }, Grid = function(_Component) {
+ }, Grid = function(_PureComponent) {
function Grid(props, context) {
(0, _classCallCheck3.default)(this, Grid);
var _this = (0, _possibleConstructorReturn3.default)(this, (Grid.__proto__ || (0,
_getPrototypeOf2.default)(Grid)).call(this, props, context));
- return _this.state = {
+ _this.state = {
isScrolling: !1,
- scrollDirectionHorizontal: _getOverscanIndices.SCROLL_DIRECTION_FIXED,
- scrollDirectionVertical: _getOverscanIndices.SCROLL_DIRECTION_FIXED,
+ scrollDirectionHorizontal: _defaultOverscanIndicesGetter.SCROLL_DIRECTION_FORWARD,
+ scrollDirectionVertical: _defaultOverscanIndicesGetter.SCROLL_DIRECTION_FORWARD,
scrollLeft: 0,
scrollTop: 0
}, _this._onGridRenderedMemoizer = (0, _createCallbackMemoizer2.default)(), _this._onScrollMemoizer = (0,
- _createCallbackMemoizer2.default)(!1), _this._enablePointerEventsAfterDelayCallback = _this._enablePointerEventsAfterDelayCallback.bind(_this),
+ _createCallbackMemoizer2.default)(!1), _this._debounceScrollEndedCallback = _this._debounceScrollEndedCallback.bind(_this),
_this._invokeOnGridRenderedHelper = _this._invokeOnGridRenderedHelper.bind(_this),
- _this._onScroll = _this._onScroll.bind(_this), _this._updateScrollLeftForScrollToColumn = _this._updateScrollLeftForScrollToColumn.bind(_this),
+ _this._onScroll = _this._onScroll.bind(_this), _this._setScrollingContainerRef = _this._setScrollingContainerRef.bind(_this),
+ _this._updateScrollLeftForScrollToColumn = _this._updateScrollLeftForScrollToColumn.bind(_this),
_this._updateScrollTopForScrollToRow = _this._updateScrollTopForScrollToRow.bind(_this),
_this._columnWidthGetter = _this._wrapSizeGetter(props.columnWidth), _this._rowHeightGetter = _this._wrapSizeGetter(props.rowHeight),
- _this._columnSizeAndPositionManager = new _ScalingCellSizeAndPositionManager2.default({
+ _this._deferredInvalidateColumnIndex = null, _this._deferredInvalidateRowIndex = null,
+ _this._recomputeScrollLeftFlag = !1, _this._recomputeScrollTopFlag = !1;
+ var deferredMeasurementCache = props.deferredMeasurementCache, deferredMode = "undefined" != typeof deferredMeasurementCache;
+ return _this._columnSizeAndPositionManager = new _ScalingCellSizeAndPositionManager2.default({
+ batchAllCells: deferredMode && !deferredMeasurementCache.hasFixedHeight(),
cellCount: props.columnCount,
- cellSizeGetter: function(index) {
- return _this._columnWidthGetter(index);
+ cellSizeGetter: function(params) {
+ return _this._columnWidthGetter(params);
},
estimatedCellSize: _this._getEstimatedColumnSize(props)
}), _this._rowSizeAndPositionManager = new _ScalingCellSizeAndPositionManager2.default({
+ batchAllCells: deferredMode && !deferredMeasurementCache.hasFixedWidth(),
cellCount: props.rowCount,
- cellSizeGetter: function(index) {
- return _this._rowHeightGetter(index);
+ cellSizeGetter: function(params) {
+ return _this._rowHeightGetter(params);
},
estimatedCellSize: _this._getEstimatedRowSize(props)
- }), _this._cellCache = {}, _this;
+ }), _this._cellCache = {}, _this._styleCache = {}, _this;
}
- return (0, _inherits3.default)(Grid, _Component), (0, _createClass3.default)(Grid, [ {
+ return (0, _inherits3.default)(Grid, _PureComponent), (0, _createClass3.default)(Grid, [ {
+ key: "invalidateCellSizeAfterRender",
+ value: function(_ref) {
+ var columnIndex = _ref.columnIndex, rowIndex = _ref.rowIndex;
+ this._deferredInvalidateColumnIndex = "number" == typeof this._deferredInvalidateColumnIndex ? Math.min(this._deferredInvalidateColumnIndex, columnIndex) : columnIndex,
+ this._deferredInvalidateRowIndex = "number" == typeof this._deferredInvalidateRowIndex ? Math.min(this._deferredInvalidateRowIndex, rowIndex) : rowIndex;
+ }
+ }, {
key: "measureAllCells",
value: function() {
var _props = this.props, columnCount = _props.columnCount, rowCount = _props.rowCount;
this._columnSizeAndPositionManager.getSizeAndPositionOfCell(columnCount - 1), this._rowSizeAndPositionManager.getSizeAndPositionOfCell(rowCount - 1);
}
}, {
key: "recomputeGridSize",
value: function() {
- var _ref = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, _ref$columnIndex = _ref.columnIndex, columnIndex = void 0 === _ref$columnIndex ? 0 : _ref$columnIndex, _ref$rowIndex = _ref.rowIndex, rowIndex = void 0 === _ref$rowIndex ? 0 : _ref$rowIndex;
+ var _ref2 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, _ref2$columnIndex = _ref2.columnIndex, columnIndex = void 0 === _ref2$columnIndex ? 0 : _ref2$columnIndex, _ref2$rowIndex = _ref2.rowIndex, rowIndex = void 0 === _ref2$rowIndex ? 0 : _ref2$rowIndex, _props2 = this.props, scrollToColumn = _props2.scrollToColumn, scrollToRow = _props2.scrollToRow;
this._columnSizeAndPositionManager.resetCell(columnIndex), this._rowSizeAndPositionManager.resetCell(rowIndex),
- this._cellCache = {}, this.forceUpdate();
+ this._recomputeScrollLeftFlag = scrollToColumn >= 0 && columnIndex <= scrollToColumn,
+ this._recomputeScrollTopFlag = scrollToRow >= 0 && rowIndex <= scrollToRow, this._cellCache = {},
+ this._styleCache = {}, this.forceUpdate();
+ }
+ }, {
+ key: "scrollToCell",
+ value: function(_ref3) {
+ var columnIndex = _ref3.columnIndex, rowIndex = _ref3.rowIndex, props = this.props;
+ this._updateScrollLeftForScrollToColumn((0, _extends3.default)({}, props, {
+ scrollToColumn: columnIndex
+ })), this._updateScrollTopForScrollToRow((0, _extends3.default)({}, props, {
+ scrollToRow: rowIndex
+ }));
}
}, {
key: "componentDidMount",
value: function() {
- var _props2 = this.props, scrollLeft = _props2.scrollLeft, scrollToColumn = _props2.scrollToColumn, scrollTop = _props2.scrollTop, scrollToRow = _props2.scrollToRow;
- this._scrollbarSizeMeasured || (this._scrollbarSize = (0, _scrollbarSize2.default)(),
+ var _props3 = this.props, getScrollbarSize = _props3.getScrollbarSize, scrollLeft = _props3.scrollLeft, scrollToColumn = _props3.scrollToColumn, scrollTop = _props3.scrollTop, scrollToRow = _props3.scrollToRow;
+ this._handleInvalidatedGridSize(), this._scrollbarSizeMeasured || (this._scrollbarSize = getScrollbarSize(),
this._scrollbarSizeMeasured = !0, this.setState({})), (scrollLeft >= 0 || scrollTop >= 0) && this._setScrollPosition({
scrollLeft: scrollLeft,
scrollTop: scrollTop
}), (scrollToColumn >= 0 || scrollToRow >= 0) && (this._updateScrollLeftForScrollToColumn(),
this._updateScrollTopForScrollToRow()), this._invokeOnGridRenderedHelper(), this._invokeOnScrollMemoizer({
scrollLeft: scrollLeft || 0,
scrollTop: scrollTop || 0,
totalColumnsWidth: this._columnSizeAndPositionManager.getTotalSize(),
totalRowsHeight: this._rowSizeAndPositionManager.getTotalSize()
});
}
}, {
key: "componentDidUpdate",
value: function(prevProps, prevState) {
- var _this2 = this, _props3 = this.props, autoHeight = _props3.autoHeight, columnCount = _props3.columnCount, height = _props3.height, rowCount = _props3.rowCount, scrollToAlignment = _props3.scrollToAlignment, scrollToColumn = _props3.scrollToColumn, scrollToRow = _props3.scrollToRow, width = _props3.width, _state = this.state, scrollLeft = _state.scrollLeft, scrollPositionChangeReason = _state.scrollPositionChangeReason, scrollTop = _state.scrollTop, columnOrRowCountJustIncreasedFromZero = columnCount > 0 && 0 === prevProps.columnCount || rowCount > 0 && 0 === prevProps.rowCount;
+ var _this2 = this, _props4 = this.props, autoHeight = _props4.autoHeight, columnCount = _props4.columnCount, height = _props4.height, rowCount = _props4.rowCount, scrollToAlignment = _props4.scrollToAlignment, scrollToColumn = _props4.scrollToColumn, scrollToRow = _props4.scrollToRow, width = _props4.width, _state = this.state, scrollLeft = _state.scrollLeft, scrollPositionChangeReason = _state.scrollPositionChangeReason, scrollTop = _state.scrollTop;
+ this._handleInvalidatedGridSize();
+ var columnOrRowCountJustIncreasedFromZero = columnCount > 0 && 0 === prevProps.columnCount || rowCount > 0 && 0 === prevProps.rowCount;
if (scrollPositionChangeReason === SCROLL_POSITION_CHANGE_REASONS.REQUESTED && (scrollLeft >= 0 && (scrollLeft !== prevState.scrollLeft && scrollLeft !== this._scrollingContainer.scrollLeft || columnOrRowCountJustIncreasedFromZero) && (this._scrollingContainer.scrollLeft = scrollLeft),
!autoHeight && scrollTop >= 0 && (scrollTop !== prevState.scrollTop && scrollTop !== this._scrollingContainer.scrollTop || columnOrRowCountJustIncreasedFromZero) && (this._scrollingContainer.scrollTop = scrollTop)),
- (0, _updateScrollIndexHelper2.default)({
+ this._recomputeScrollLeftFlag ? (this._recomputeScrollLeftFlag = !1, this._updateScrollLeftForScrollToColumn(this.props)) : (0,
+ _updateScrollIndexHelper2.default)({
cellSizeAndPositionManager: this._columnSizeAndPositionManager,
previousCellsCount: prevProps.columnCount,
previousCellSize: prevProps.columnWidth,
previousScrollToAlignment: prevProps.scrollToAlignment,
previousScrollToIndex: prevProps.scrollToColumn,
previousSize: prevProps.width,
scrollOffset: scrollLeft,
scrollToAlignment: scrollToAlignment,
scrollToIndex: scrollToColumn,
size: width,
updateScrollIndexCallback: function(scrollToColumn) {
- return _this2._updateScrollLeftForScrollToColumn((0, _extends3.default)({}, _this2.props, {
- scrollToColumn: scrollToColumn
- }));
+ return _this2._updateScrollLeftForScrollToColumn(_this2.props);
}
- }), (0, _updateScrollIndexHelper2.default)({
+ }), this._recomputeScrollTopFlag ? (this._recomputeScrollTopFlag = !1, this._updateScrollTopForScrollToRow(this.props)) : (0,
+ _updateScrollIndexHelper2.default)({
cellSizeAndPositionManager: this._rowSizeAndPositionManager,
previousCellsCount: prevProps.rowCount,
previousCellSize: prevProps.rowHeight,
previousScrollToAlignment: prevProps.scrollToAlignment,
previousScrollToIndex: prevProps.scrollToRow,
previousSize: prevProps.height,
scrollOffset: scrollTop,
scrollToAlignment: scrollToAlignment,
scrollToIndex: scrollToRow,
size: height,
updateScrollIndexCallback: function(scrollToRow) {
- return _this2._updateScrollTopForScrollToRow((0, _extends3.default)({}, _this2.props, {
- scrollToRow: scrollToRow
- }));
+ return _this2._updateScrollTopForScrollToRow(_this2.props);
}
}), this._invokeOnGridRenderedHelper(), scrollLeft !== prevState.scrollLeft || scrollTop !== prevState.scrollTop) {
var totalRowsHeight = this._rowSizeAndPositionManager.getTotalSize(), totalColumnsWidth = this._columnSizeAndPositionManager.getTotalSize();
this._invokeOnScrollMemoizer({
scrollLeft: scrollLeft,
scrollTop: scrollTop,
totalColumnsWidth: totalColumnsWidth,
totalRowsHeight: totalRowsHeight
});
}
}
}, {
key: "componentWillMount",
value: function() {
- this._scrollbarSize = (0, _scrollbarSize2.default)(), void 0 === this._scrollbarSize ? (this._scrollbarSizeMeasured = !1,
+ var getScrollbarSize = this.props.getScrollbarSize;
+ this._scrollbarSize = getScrollbarSize(), void 0 === this._scrollbarSize ? (this._scrollbarSizeMeasured = !1,
this._scrollbarSize = 0) : this._scrollbarSizeMeasured = !0, this._calculateChildrenToRender();
}
}, {
key: "componentWillUnmount",
value: function() {
this._disablePointerEventsTimeoutId && clearTimeout(this._disablePointerEventsTimeoutId);
}
}, {
- key: "componentWillUpdate",
- value: function(nextProps, nextState) {
- var _this3 = this;
- 0 === nextProps.columnCount && 0 !== nextState.scrollLeft || 0 === nextProps.rowCount && 0 !== nextState.scrollTop ? this._setScrollPosition({
+ key: "componentWillReceiveProps",
+ value: function(nextProps) {
+ var _this3 = this, _state2 = this.state, scrollLeft = _state2.scrollLeft, scrollTop = _state2.scrollTop;
+ if (0 === nextProps.columnCount && 0 !== scrollLeft || 0 === nextProps.rowCount && 0 !== scrollTop) this._setScrollPosition({
scrollLeft: 0,
scrollTop: 0
- }) : nextProps.scrollLeft === this.props.scrollLeft && nextProps.scrollTop === this.props.scrollTop || this._setScrollPosition({
- scrollLeft: nextProps.scrollLeft,
- scrollTop: nextProps.scrollTop
- }), this._columnWidthGetter = this._wrapSizeGetter(nextProps.columnWidth), this._rowHeightGetter = this._wrapSizeGetter(nextProps.rowHeight),
+ }); else if (nextProps.scrollLeft !== this.props.scrollLeft || nextProps.scrollTop !== this.props.scrollTop) {
+ var newState = {};
+ null != nextProps.scrollLeft && (newState.scrollLeft = nextProps.scrollLeft), null != nextProps.scrollTop && (newState.scrollTop = nextProps.scrollTop),
+ this._setScrollPosition(newState);
+ }
+ nextProps.columnWidth === this.props.columnWidth && nextProps.rowHeight === this.props.rowHeight || (this._styleCache = {}),
+ this._columnWidthGetter = this._wrapSizeGetter(nextProps.columnWidth), this._rowHeightGetter = this._wrapSizeGetter(nextProps.rowHeight),
this._columnSizeAndPositionManager.configure({
cellCount: nextProps.columnCount,
estimatedCellSize: this._getEstimatedColumnSize(nextProps)
}), this._rowSizeAndPositionManager.configure({
cellCount: nextProps.rowCount,
estimatedCellSize: this._getEstimatedRowSize(nextProps)
- }), (0, _calculateSizeAndPositionDataAndUpdateScrollOffset2.default)({
- cellCount: this.props.columnCount,
+ });
+ var _props5 = this.props, columnCount = _props5.columnCount, rowCount = _props5.rowCount;
+ 0 !== columnCount && 0 !== rowCount || (columnCount = 0, rowCount = 0), (0, _calculateSizeAndPositionDataAndUpdateScrollOffset2.default)({
+ cellCount: columnCount,
cellSize: this.props.columnWidth,
computeMetadataCallback: function() {
return _this3._columnSizeAndPositionManager.resetCell(0);
},
computeMetadataCallbackProps: nextProps,
nextCellsCount: nextProps.columnCount,
nextCellSize: nextProps.columnWidth,
nextScrollToIndex: nextProps.scrollToColumn,
scrollToIndex: this.props.scrollToColumn,
updateScrollOffsetForScrollToIndex: function() {
- return _this3._updateScrollLeftForScrollToColumn(nextProps, nextState);
+ return _this3._updateScrollLeftForScrollToColumn(nextProps, _this3.state);
}
}), (0, _calculateSizeAndPositionDataAndUpdateScrollOffset2.default)({
- cellCount: this.props.rowCount,
+ cellCount: rowCount,
cellSize: this.props.rowHeight,
computeMetadataCallback: function() {
return _this3._rowSizeAndPositionManager.resetCell(0);
},
computeMetadataCallbackProps: nextProps,
nextCellsCount: nextProps.rowCount,
nextCellSize: nextProps.rowHeight,
nextScrollToIndex: nextProps.scrollToRow,
scrollToIndex: this.props.scrollToRow,
updateScrollOffsetForScrollToIndex: function() {
- return _this3._updateScrollTopForScrollToRow(nextProps, nextState);
+ return _this3._updateScrollTopForScrollToRow(nextProps, _this3.state);
}
- }), this._calculateChildrenToRender(nextProps, nextState);
+ });
+ }
+ }, {
+ key: "componentWillUpdate",
+ value: function(nextProps, nextState) {
+ this._calculateChildrenToRender(nextProps, nextState);
}
}, {
key: "render",
value: function() {
- var _this4 = this, _props4 = this.props, autoContainerWidth = _props4.autoContainerWidth, autoHeight = _props4.autoHeight, className = _props4.className, containerStyle = _props4.containerStyle, height = _props4.height, id = _props4.id, noContentRenderer = _props4.noContentRenderer, style = _props4.style, tabIndex = _props4.tabIndex, width = _props4.width, isScrolling = this.state.isScrolling, gridStyle = {
+ var _props6 = this.props, autoContainerWidth = _props6.autoContainerWidth, autoHeight = _props6.autoHeight, className = _props6.className, containerStyle = _props6.containerStyle, height = _props6.height, id = _props6.id, noContentRenderer = _props6.noContentRenderer, style = _props6.style, tabIndex = _props6.tabIndex, width = _props6.width, isScrolling = this.state.isScrolling, gridStyle = {
boxSizing: "border-box",
+ direction: "ltr",
height: autoHeight ? "auto" : height,
position: "relative",
width: width,
WebkitOverflowScrolling: "touch",
willChange: "transform"
}, totalColumnsWidth = this._columnSizeAndPositionManager.getTotalSize(), totalRowsHeight = this._rowSizeAndPositionManager.getTotalSize(), verticalScrollBarSize = totalRowsHeight > height ? this._scrollbarSize : 0, horizontalScrollBarSize = totalColumnsWidth > width ? this._scrollbarSize : 0;
gridStyle.overflowX = totalColumnsWidth + verticalScrollBarSize <= width ? "hidden" : "auto",
gridStyle.overflowY = totalRowsHeight + horizontalScrollBarSize <= height ? "hidden" : "auto";
var childrenToDisplay = this._childrenToDisplay, showNoContentRenderer = 0 === childrenToDisplay.length && height > 0 && width > 0;
return _react2.default.createElement("div", {
- ref: function(_ref2) {
- _this4._scrollingContainer = _ref2;
- },
+ ref: this._setScrollingContainerRef,
"aria-label": this.props["aria-label"],
className: (0, _classnames2.default)("ReactVirtualized__Grid", className),
id: id,
onScroll: this._onScroll,
role: "grid",
style: (0, _extends3.default)({}, gridStyle, style),
tabIndex: tabIndex
}, childrenToDisplay.length > 0 && _react2.default.createElement("div", {
@@ -2762,101 +3313,116 @@ var REACT_SHALLOW_COMPARE = "devtools/cl
maxWidth: totalColumnsWidth,
maxHeight: totalRowsHeight,
overflow: "hidden",
pointerEvents: isScrolling ? "none" : ""
}, containerStyle)
}, childrenToDisplay), showNoContentRenderer && noContentRenderer());
}
}, {
- key: "shouldComponentUpdate",
- value: function(nextProps, nextState) {
- return (0, _reactAddonsShallowCompare2.default)(this, nextProps, nextState);
- }
- }, {
key: "_calculateChildrenToRender",
value: function() {
- var props = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : this.props, state = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this.state, cellRenderer = props.cellRenderer, cellRangeRenderer = props.cellRangeRenderer, columnCount = props.columnCount, height = props.height, overscanColumnCount = props.overscanColumnCount, overscanRowCount = props.overscanRowCount, rowCount = props.rowCount, width = props.width, isScrolling = state.isScrolling, scrollDirectionHorizontal = state.scrollDirectionHorizontal, scrollDirectionVertical = state.scrollDirectionVertical, scrollLeft = state.scrollLeft, scrollTop = state.scrollTop;
+ var props = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : this.props, state = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this.state, cellRenderer = props.cellRenderer, cellRangeRenderer = props.cellRangeRenderer, columnCount = props.columnCount, deferredMeasurementCache = props.deferredMeasurementCache, height = props.height, overscanColumnCount = props.overscanColumnCount, overscanIndicesGetter = props.overscanIndicesGetter, overscanRowCount = props.overscanRowCount, rowCount = props.rowCount, width = props.width, isScrolling = state.isScrolling, scrollDirectionHorizontal = state.scrollDirectionHorizontal, scrollDirectionVertical = state.scrollDirectionVertical, scrollLeft = state.scrollLeft, scrollTop = state.scrollTop;
if (this._childrenToDisplay = [], height > 0 && width > 0) {
var visibleColumnIndices = this._columnSizeAndPositionManager.getVisibleCellRange({
containerSize: width,
offset: scrollLeft
}), visibleRowIndices = this._rowSizeAndPositionManager.getVisibleCellRange({
containerSize: height,
offset: scrollTop
}), horizontalOffsetAdjustment = this._columnSizeAndPositionManager.getOffsetAdjustment({
containerSize: width,
offset: scrollLeft
}), verticalOffsetAdjustment = this._rowSizeAndPositionManager.getOffsetAdjustment({
containerSize: height,
offset: scrollTop
});
this._renderedColumnStartIndex = visibleColumnIndices.start, this._renderedColumnStopIndex = visibleColumnIndices.stop,
this._renderedRowStartIndex = visibleRowIndices.start, this._renderedRowStopIndex = visibleRowIndices.stop;
- var overscanColumnIndices = (0, _getOverscanIndices2.default)({
+ var overscanColumnIndices = overscanIndicesGetter({
cellCount: columnCount,
overscanCellsCount: overscanColumnCount,
scrollDirection: scrollDirectionHorizontal,
startIndex: this._renderedColumnStartIndex,
stopIndex: this._renderedColumnStopIndex
- }), overscanRowIndices = (0, _getOverscanIndices2.default)({
+ }), overscanRowIndices = overscanIndicesGetter({
cellCount: rowCount,
overscanCellsCount: overscanRowCount,
scrollDirection: scrollDirectionVertical,
startIndex: this._renderedRowStartIndex,
stopIndex: this._renderedRowStopIndex
});
this._columnStartIndex = overscanColumnIndices.overscanStartIndex, this._columnStopIndex = overscanColumnIndices.overscanStopIndex,
this._rowStartIndex = overscanRowIndices.overscanStartIndex, this._rowStopIndex = overscanRowIndices.overscanStopIndex,
this._childrenToDisplay = cellRangeRenderer({
cellCache: this._cellCache,
cellRenderer: cellRenderer,
columnSizeAndPositionManager: this._columnSizeAndPositionManager,
columnStartIndex: this._columnStartIndex,
columnStopIndex: this._columnStopIndex,
+ deferredMeasurementCache: deferredMeasurementCache,
horizontalOffsetAdjustment: horizontalOffsetAdjustment,
isScrolling: isScrolling,
+ parent: this,
rowSizeAndPositionManager: this._rowSizeAndPositionManager,
rowStartIndex: this._rowStartIndex,
rowStopIndex: this._rowStopIndex,
scrollLeft: scrollLeft,
scrollTop: scrollTop,
+ styleCache: this._styleCache,
verticalOffsetAdjustment: verticalOffsetAdjustment,
visibleColumnIndices: visibleColumnIndices,
visibleRowIndices: visibleRowIndices
});
}
}
}, {
- key: "_enablePointerEventsAfterDelay",
+ key: "_debounceScrollEnded",
value: function() {
var scrollingResetTimeInterval = this.props.scrollingResetTimeInterval;
this._disablePointerEventsTimeoutId && clearTimeout(this._disablePointerEventsTimeoutId),
- this._disablePointerEventsTimeoutId = setTimeout(this._enablePointerEventsAfterDelayCallback, scrollingResetTimeInterval);
+ this._disablePointerEventsTimeoutId = setTimeout(this._debounceScrollEndedCallback, scrollingResetTimeInterval);
}
}, {
- key: "_enablePointerEventsAfterDelayCallback",
+ key: "_debounceScrollEndedCallback",
value: function() {
- this._disablePointerEventsTimeoutId = null, this._cellCache = {}, this.setState({
- isScrolling: !1,
- scrollDirectionHorizontal: _getOverscanIndices.SCROLL_DIRECTION_FIXED,
- scrollDirectionVertical: _getOverscanIndices.SCROLL_DIRECTION_FIXED
+ this._disablePointerEventsTimeoutId = null;
+ var styleCache = this._styleCache;
+ this._cellCache = {}, this._styleCache = {};
+ for (var rowIndex = this._rowStartIndex; rowIndex <= this._rowStopIndex; rowIndex++) for (var columnIndex = this._columnStartIndex; columnIndex <= this._columnStopIndex; columnIndex++) {
+ var key = rowIndex + "-" + columnIndex;
+ this._styleCache[key] = styleCache[key];
+ }
+ this.setState({
+ isScrolling: !1
});
}
}, {
key: "_getEstimatedColumnSize",
value: function(props) {
return "number" == typeof props.columnWidth ? props.columnWidth : props.estimatedColumnSize;
}
}, {
key: "_getEstimatedRowSize",
value: function(props) {
return "number" == typeof props.rowHeight ? props.rowHeight : props.estimatedRowSize;
}
}, {
+ key: "_handleInvalidatedGridSize",
+ value: function() {
+ if ("number" == typeof this._deferredInvalidateColumnIndex) {
+ var columnIndex = this._deferredInvalidateColumnIndex, rowIndex = this._deferredInvalidateRowIndex;
+ delete this._deferredInvalidateColumnIndex, delete this._deferredInvalidateRowIndex,
+ this.recomputeGridSize({
+ columnIndex: columnIndex,
+ rowIndex: rowIndex
+ });
+ }
+ }
+ }, {
key: "_invokeOnGridRenderedHelper",
value: function() {
var onSectionRendered = this.props.onSectionRendered;
this._onGridRenderedMemoizer({
callback: onSectionRendered,
indices: {
columnOverscanStartIndex: this._columnStartIndex,
columnOverscanStopIndex: this._columnStopIndex,
@@ -2866,169 +3432,183 @@ var REACT_SHALLOW_COMPARE = "devtools/cl
rowOverscanStopIndex: this._rowStopIndex,
rowStartIndex: this._renderedRowStartIndex,
rowStopIndex: this._renderedRowStopIndex
}
});
}
}, {
key: "_invokeOnScrollMemoizer",
- value: function(_ref3) {
- var _this5 = this, scrollLeft = _ref3.scrollLeft, scrollTop = _ref3.scrollTop, totalColumnsWidth = _ref3.totalColumnsWidth, totalRowsHeight = _ref3.totalRowsHeight;
+ value: function(_ref4) {
+ var _this4 = this, scrollLeft = _ref4.scrollLeft, scrollTop = _ref4.scrollTop, totalColumnsWidth = _ref4.totalColumnsWidth, totalRowsHeight = _ref4.totalRowsHeight;
this._onScrollMemoizer({
- callback: function(_ref4) {
- var scrollLeft = _ref4.scrollLeft, scrollTop = _ref4.scrollTop, _props5 = _this5.props, height = _props5.height, onScroll = _props5.onScroll, width = _props5.width;
+ callback: function(_ref5) {
+ var scrollLeft = _ref5.scrollLeft, scrollTop = _ref5.scrollTop, _props7 = _this4.props, height = _props7.height, onScroll = _props7.onScroll, width = _props7.width;
onScroll({
clientHeight: height,
clientWidth: width,
scrollHeight: totalRowsHeight,
scrollLeft: scrollLeft,
scrollTop: scrollTop,
scrollWidth: totalColumnsWidth
});
},
indices: {
scrollLeft: scrollLeft,
scrollTop: scrollTop
}
});
}
}, {
+ key: "_setScrollingContainerRef",
+ value: function(ref) {
+ this._scrollingContainer = ref;
+ }
+ }, {
key: "_setScrollPosition",
- value: function(_ref5) {
- var scrollLeft = _ref5.scrollLeft, scrollTop = _ref5.scrollTop, newState = {
+ value: function(_ref6) {
+ var scrollLeft = _ref6.scrollLeft, scrollTop = _ref6.scrollTop, newState = {
scrollPositionChangeReason: SCROLL_POSITION_CHANGE_REASONS.REQUESTED
};
- scrollLeft >= 0 && (newState.scrollLeft = scrollLeft), scrollTop >= 0 && (newState.scrollTop = scrollTop),
- (scrollLeft >= 0 && scrollLeft !== this.state.scrollLeft || scrollTop >= 0 && scrollTop !== this.state.scrollTop) && this.setState(newState);
+ scrollLeft >= 0 && (newState.scrollDirectionHorizontal = scrollLeft > this.state.scrollLeft ? _defaultOverscanIndicesGetter.SCROLL_DIRECTION_FORWARD : _defaultOverscanIndicesGetter.SCROLL_DIRECTION_BACKWARD,
+ newState.scrollLeft = scrollLeft), scrollTop >= 0 && (newState.scrollDirectionVertical = scrollTop > this.state.scrollTop ? _defaultOverscanIndicesGetter.SCROLL_DIRECTION_FORWARD : _defaultOverscanIndicesGetter.SCROLL_DIRECTION_BACKWARD,
+ newState.scrollTop = scrollTop), (scrollLeft >= 0 && scrollLeft !== this.state.scrollLeft || scrollTop >= 0 && scrollTop !== this.state.scrollTop) && this.setState(newState);
}
}, {
key: "_wrapPropertyGetter",
value: function(value) {
- return value instanceof Function ? value : function() {
+ return "function" == typeof value ? value : function() {
return value;
};
}
}, {
key: "_wrapSizeGetter",
value: function(size) {
return this._wrapPropertyGetter(size);
}
}, {
key: "_updateScrollLeftForScrollToColumn",
value: function() {
- var props = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : this.props, state = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this.state, columnCount = props.columnCount, scrollToAlignment = props.scrollToAlignment, scrollToColumn = props.scrollToColumn, width = props.width, scrollLeft = state.scrollLeft;
+ var props = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : this.props, state = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this.state, columnCount = props.columnCount, height = props.height, scrollToAlignment = props.scrollToAlignment, scrollToColumn = props.scrollToColumn, width = props.width, scrollLeft = state.scrollLeft;
if (scrollToColumn >= 0 && columnCount > 0) {
- var targetIndex = Math.max(0, Math.min(columnCount - 1, scrollToColumn)), calculatedScrollLeft = this._columnSizeAndPositionManager.getUpdatedOffsetForIndex({
+ var targetIndex = Math.max(0, Math.min(columnCount - 1, scrollToColumn)), totalRowsHeight = this._rowSizeAndPositionManager.getTotalSize(), scrollBarSize = totalRowsHeight > height ? this._scrollbarSize : 0, calculatedScrollLeft = this._columnSizeAndPositionManager.getUpdatedOffsetForIndex({
align: scrollToAlignment,
- containerSize: width,
+ containerSize: width - scrollBarSize,
currentOffset: scrollLeft,
targetIndex: targetIndex
});
scrollLeft !== calculatedScrollLeft && this._setScrollPosition({
scrollLeft: calculatedScrollLeft
});
}
}
}, {
key: "_updateScrollTopForScrollToRow",
value: function() {
- var props = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : this.props, state = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this.state, height = props.height, rowCount = props.rowCount, scrollToAlignment = props.scrollToAlignment, scrollToRow = props.scrollToRow, scrollTop = state.scrollTop;
+ var props = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : this.props, state = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this.state, height = props.height, rowCount = props.rowCount, scrollToAlignment = props.scrollToAlignment, scrollToRow = props.scrollToRow, width = props.width, scrollTop = state.scrollTop;
if (scrollToRow >= 0 && rowCount > 0) {
- var targetIndex = Math.max(0, Math.min(rowCount - 1, scrollToRow)), calculatedScrollTop = this._rowSizeAndPositionManager.getUpdatedOffsetForIndex({
+ var targetIndex = Math.max(0, Math.min(rowCount - 1, scrollToRow)), totalColumnsWidth = this._columnSizeAndPositionManager.getTotalSize(), scrollBarSize = totalColumnsWidth > width ? this._scrollbarSize : 0, calculatedScrollTop = this._rowSizeAndPositionManager.getUpdatedOffsetForIndex({
align: scrollToAlignment,
- containerSize: height,
+ containerSize: height - scrollBarSize,
currentOffset: scrollTop,
targetIndex: targetIndex
});
scrollTop !== calculatedScrollTop && this._setScrollPosition({
scrollTop: calculatedScrollTop
});
}
}
}, {
key: "_onScroll",
value: function(event) {
- if (event.target === this._scrollingContainer) {
- this._enablePointerEventsAfterDelay();
- var _props6 = this.props, height = _props6.height, width = _props6.width, scrollbarSize = this._scrollbarSize, totalRowsHeight = this._rowSizeAndPositionManager.getTotalSize(), totalColumnsWidth = this._columnSizeAndPositionManager.getTotalSize(), scrollLeft = Math.min(Math.max(0, totalColumnsWidth - width + scrollbarSize), event.target.scrollLeft), scrollTop = Math.min(Math.max(0, totalRowsHeight - height + scrollbarSize), event.target.scrollTop);
+ if (event.target === this._scrollingContainer && !(event.target.scrollTop < 0)) {
+ this._debounceScrollEnded();
+ var _props8 = this.props, autoHeight = _props8.autoHeight, height = _props8.height, width = _props8.width, scrollbarSize = this._scrollbarSize, totalRowsHeight = this._rowSizeAndPositionManager.getTotalSize(), totalColumnsWidth = this._columnSizeAndPositionManager.getTotalSize(), scrollLeft = Math.min(Math.max(0, totalColumnsWidth - width + scrollbarSize), event.target.scrollLeft), scrollTop = Math.min(Math.max(0, totalRowsHeight - height + scrollbarSize), event.target.scrollTop);
if (this.state.scrollLeft !== scrollLeft || this.state.scrollTop !== scrollTop) {
- var scrollDirectionVertical = scrollTop > this.state.scrollTop ? _getOverscanIndices.SCROLL_DIRECTION_FORWARD : _getOverscanIndices.SCROLL_DIRECTION_BACKWARD, scrollDirectionHorizontal = scrollLeft > this.state.scrollLeft ? _getOverscanIndices.SCROLL_DIRECTION_FORWARD : _getOverscanIndices.SCROLL_DIRECTION_BACKWARD;
- this.setState({
+ var scrollDirectionHorizontal = scrollLeft > this.state.scrollLeft ? _defaultOverscanIndicesGetter.SCROLL_DIRECTION_FORWARD : _defaultOverscanIndicesGetter.SCROLL_DIRECTION_BACKWARD, scrollDirectionVertical = scrollTop > this.state.scrollTop ? _defaultOverscanIndicesGetter.SCROLL_DIRECTION_FORWARD : _defaultOverscanIndicesGetter.SCROLL_DIRECTION_BACKWARD, newState = {
isScrolling: !0,
scrollDirectionHorizontal: scrollDirectionHorizontal,
scrollDirectionVertical: scrollDirectionVertical,
scrollLeft: scrollLeft,
- scrollPositionChangeReason: SCROLL_POSITION_CHANGE_REASONS.OBSERVED,
- scrollTop: scrollTop
- });
+ scrollPositionChangeReason: SCROLL_POSITION_CHANGE_REASONS.OBSERVED
+ };
+ autoHeight || (newState.scrollTop = scrollTop), this.setState(newState);
}
this._invokeOnScrollMemoizer({
scrollLeft: scrollLeft,
scrollTop: scrollTop,
totalColumnsWidth: totalColumnsWidth,
totalRowsHeight: totalRowsHeight
});
}
}
} ]), Grid;
- }(_react.Component);
+ }(_react.PureComponent);
Grid.defaultProps = {
"aria-label": "grid",
cellRangeRenderer: _defaultCellRangeRenderer2.default,
estimatedColumnSize: 100,
estimatedRowSize: 30,
+ getScrollbarSize: __webpack_require__(112),
noContentRenderer: function() {
return null;
},
onScroll: function() {
return null;
},
onSectionRendered: function() {
return null;
},
overscanColumnCount: 0,
+ overscanIndicesGetter: _defaultOverscanIndicesGetter2.default,
overscanRowCount: 10,
scrollingResetTimeInterval: DEFAULT_SCROLLING_RESET_TIME_INTERVAL,
scrollToAlignment: "auto",
+ scrollToColumn: -1,
+ scrollToRow: -1,
style: {},
tabIndex: 0
}, exports.default = Grid;
- }, /* 122 */
+ }, /* 130 */
/***/
function(module, exports) {
"use strict";
function calculateSizeAndPositionDataAndUpdateScrollOffset(_ref) {
var cellCount = _ref.cellCount, cellSize = _ref.cellSize, computeMetadataCallback = _ref.computeMetadataCallback, computeMetadataCallbackProps = _ref.computeMetadataCallbackProps, nextCellsCount = _ref.nextCellsCount, nextCellSize = _ref.nextCellSize, nextScrollToIndex = _ref.nextScrollToIndex, scrollToIndex = _ref.scrollToIndex, updateScrollOffsetForScrollToIndex = _ref.updateScrollOffsetForScrollToIndex;
cellCount === nextCellsCount && ("number" != typeof cellSize && "number" != typeof nextCellSize || cellSize === nextCellSize) || (computeMetadataCallback(computeMetadataCallbackProps),
scrollToIndex >= 0 && scrollToIndex === nextScrollToIndex && updateScrollOffsetForScrollToIndex());
}
Object.defineProperty(exports, "__esModule", {
value: !0
}), exports.default = calculateSizeAndPositionDataAndUpdateScrollOffset;
- }, /* 123 */
+ }, /* 131 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
Object.defineProperty(exports, "__esModule", {
value: !0
}), exports.DEFAULT_MAX_SCROLL_SIZE = void 0;
- var _objectWithoutProperties2 = __webpack_require__(105), _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2), _classCallCheck2 = __webpack_require__(29), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _createClass2 = __webpack_require__(30), _createClass3 = _interopRequireDefault(_createClass2), _CellSizeAndPositionManager = __webpack_require__(124), _CellSizeAndPositionManager2 = _interopRequireDefault(_CellSizeAndPositionManager), DEFAULT_MAX_SCROLL_SIZE = exports.DEFAULT_MAX_SCROLL_SIZE = 15e5, ScalingCellSizeAndPositionManager = function() {
+ var _objectWithoutProperties2 = __webpack_require__(105), _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2), _classCallCheck2 = __webpack_require__(29), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _createClass2 = __webpack_require__(30), _createClass3 = _interopRequireDefault(_createClass2), _CellSizeAndPositionManager = __webpack_require__(132), _CellSizeAndPositionManager2 = _interopRequireDefault(_CellSizeAndPositionManager), DEFAULT_MAX_SCROLL_SIZE = exports.DEFAULT_MAX_SCROLL_SIZE = 15e5, ScalingCellSizeAndPositionManager = function() {
function ScalingCellSizeAndPositionManager(_ref) {
var _ref$maxScrollSize = _ref.maxScrollSize, maxScrollSize = void 0 === _ref$maxScrollSize ? DEFAULT_MAX_SCROLL_SIZE : _ref$maxScrollSize, params = (0,
_objectWithoutProperties3.default)(_ref, [ "maxScrollSize" ]);
(0, _classCallCheck3.default)(this, ScalingCellSizeAndPositionManager), this._cellSizeAndPositionManager = new _CellSizeAndPositionManager2.default(params),
this._maxScrollSize = maxScrollSize;
}
return (0, _createClass3.default)(ScalingCellSizeAndPositionManager, [ {
+ key: "areOffsetsAdjusted",
+ value: function() {
+ return this._cellSizeAndPositionManager.getTotalSize() > this._maxScrollSize;
+ }
+ }, {
key: "configure",
value: function(params) {
this._cellSizeAndPositionManager.configure(params);
}
}, {
key: "getCellCount",
value: function() {
return this._cellSizeAndPositionManager.getCellCount();
@@ -3133,36 +3713,41 @@ var REACT_SHALLOW_COMPARE = "devtools/cl
offset: offset,
totalSize: safeTotalSize
});
return Math.round(offsetPercentage * (totalSize - containerSize));
}
} ]), ScalingCellSizeAndPositionManager;
}();
exports.default = ScalingCellSizeAndPositionManager;
- }, /* 124 */
+ }, /* 132 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
Object.defineProperty(exports, "__esModule", {
value: !0
});
var _classCallCheck2 = __webpack_require__(29), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _createClass2 = __webpack_require__(30), _createClass3 = _interopRequireDefault(_createClass2), CellSizeAndPositionManager = function() {
function CellSizeAndPositionManager(_ref) {
- var cellCount = _ref.cellCount, cellSizeGetter = _ref.cellSizeGetter, estimatedCellSize = _ref.estimatedCellSize;
- (0, _classCallCheck3.default)(this, CellSizeAndPositionManager), this._cellSizeGetter = cellSizeGetter,
- this._cellCount = cellCount, this._estimatedCellSize = estimatedCellSize, this._cellSizeAndPositionData = {},
- this._lastMeasuredIndex = -1;
+ var _ref$batchAllCells = _ref.batchAllCells, batchAllCells = void 0 !== _ref$batchAllCells && _ref$batchAllCells, cellCount = _ref.cellCount, cellSizeGetter = _ref.cellSizeGetter, estimatedCellSize = _ref.estimatedCellSize;
+ (0, _classCallCheck3.default)(this, CellSizeAndPositionManager), this._batchAllCells = batchAllCells,
+ this._cellSizeGetter = cellSizeGetter, this._cellCount = cellCount, this._estimatedCellSize = estimatedCellSize,
+ this._cellSizeAndPositionData = {}, this._lastMeasuredIndex = -1, this._lastBatchedIndex = -1;
}
return (0, _createClass3.default)(CellSizeAndPositionManager, [ {
+ key: "areOffsetsAdjusted",
+ value: function() {
+ return !1;
+ }
+ }, {
key: "configure",
value: function(_ref2) {
var cellCount = _ref2.cellCount, estimatedCellSize = _ref2.estimatedCellSize;
this._cellCount = cellCount, this._estimatedCellSize = estimatedCellSize;
}
}, {
key: "getCellCount",
value: function() {
@@ -3174,31 +3759,37 @@ var REACT_SHALLOW_COMPARE = "devtools/cl
return this._estimatedCellSize;
}
}, {
key: "getLastMeasuredIndex",
value: function() {
return this._lastMeasuredIndex;
}
}, {
+ key: "getOffsetAdjustment",
+ value: function(_ref3) {
+ _ref3.containerSize, _ref3.offset;
+ return 0;
+ }
+ }, {
key: "getSizeAndPositionOfCell",
value: function(index) {
if (index < 0 || index >= this._cellCount) throw Error("Requested index " + index + " is outside of range 0.." + this._cellCount);
- if (index > this._lastMeasuredIndex) {
- for (var lastMeasuredCellSizeAndPosition = this.getSizeAndPositionOfLastMeasuredCell(), _offset = lastMeasuredCellSizeAndPosition.offset + lastMeasuredCellSizeAndPosition.size, i = this._lastMeasuredIndex + 1; i <= index; i++) {
- var _size = this._cellSizeGetter({
- index: i
- });
- if (null == _size || isNaN(_size)) throw Error("Invalid size returned for cell " + i + " of value " + _size);
- this._cellSizeAndPositionData[i] = {
- offset: _offset,
- size: _size
- }, _offset += _size;
- }
- this._lastMeasuredIndex = index;
+ if (index > this._lastMeasuredIndex) for (var lastMeasuredCellSizeAndPosition = this.getSizeAndPositionOfLastMeasuredCell(), _offset = lastMeasuredCellSizeAndPosition.offset + lastMeasuredCellSizeAndPosition.size, i = this._lastMeasuredIndex + 1; i <= index; i++) {
+ var _size = this._cellSizeGetter({
+ index: i
+ });
+ if (void 0 === _size || isNaN(_size)) throw Error("Invalid size returned for cell " + i + " of value " + _size);
+ null === _size ? (this._cellSizeAndPositionData[i] = {
+ offset: _offset,
+ size: 0
+ }, this._lastBatchedIndex = index) : (this._cellSizeAndPositionData[i] = {
+ offset: _offset,
+ size: _size
+ }, _offset += _size, this._lastMeasuredIndex = index);
}
return this._cellSizeAndPositionData[index];
}
}, {
key: "getSizeAndPositionOfLastMeasuredCell",
value: function() {
return this._lastMeasuredIndex >= 0 ? this._cellSizeAndPositionData[this._lastMeasuredIndex] : {
offset: 0,
@@ -3208,18 +3799,18 @@ var REACT_SHALLOW_COMPARE = "devtools/cl
}, {
key: "getTotalSize",
value: function() {
var lastMeasuredCellSizeAndPosition = this.getSizeAndPositionOfLastMeasuredCell();
return lastMeasuredCellSizeAndPosition.offset + lastMeasuredCellSizeAndPosition.size + (this._cellCount - this._lastMeasuredIndex - 1) * this._estimatedCellSize;
}
}, {
key: "getUpdatedOffsetForIndex",
- value: function(_ref3) {
- var _ref3$align = _ref3.align, align = void 0 === _ref3$align ? "auto" : _ref3$align, containerSize = _ref3.containerSize, currentOffset = _ref3.currentOffset, targetIndex = _ref3.targetIndex;
+ value: function(_ref4) {
+ var _ref4$align = _ref4.align, align = void 0 === _ref4$align ? "auto" : _ref4$align, containerSize = _ref4.containerSize, currentOffset = _ref4.currentOffset, targetIndex = _ref4.targetIndex;
if (containerSize <= 0) return 0;
var datum = this.getSizeAndPositionOfCell(targetIndex), maxOffset = datum.offset, minOffset = maxOffset - containerSize + datum.size, idealOffset = void 0;
switch (align) {
case "start":
idealOffset = maxOffset;
break;
case "end":
@@ -3233,18 +3824,22 @@ var REACT_SHALLOW_COMPARE = "devtools/cl
default:
idealOffset = Math.max(minOffset, Math.min(maxOffset, currentOffset));
}
var totalSize = this.getTotalSize();
return Math.max(0, Math.min(totalSize - containerSize, idealOffset));
}
}, {
key: "getVisibleCellRange",
- value: function(_ref4) {
- var containerSize = _ref4.containerSize, offset = _ref4.offset, totalSize = this.getTotalSize();
+ value: function(params) {
+ if (this._batchAllCells) return {
+ start: 0,
+ stop: this._cellCount - 1
+ };
+ var containerSize = params.containerSize, offset = params.offset, totalSize = this.getTotalSize();
if (0 === totalSize) return {};
var maxOffset = offset + containerSize, start = this._findNearestCell(offset), datum = this.getSizeAndPositionOfCell(start);
offset = datum.offset + datum.size;
for (var stop = start; offset < maxOffset && stop < this._cellCount - 1; ) stop++,
offset += this.getSizeAndPositionOfCell(stop).size;
return {
start: start,
stop: stop
@@ -3289,520 +3884,128 @@ var REACT_SHALLOW_COMPARE = "devtools/cl
}) : this._exponentialSearch({
index: lastMeasuredIndex,
offset: offset
});
}
} ]), CellSizeAndPositionManager;
}();
exports.default = CellSizeAndPositionManager;
- }, /* 125 */
+ }, /* 133 */
/***/
function(module, exports) {
"use strict";
- function getOverscanIndices(_ref) {
+ function defaultOverscanIndicesGetter(_ref) {
var cellCount = _ref.cellCount, overscanCellsCount = _ref.overscanCellsCount, scrollDirection = _ref.scrollDirection, startIndex = _ref.startIndex, stopIndex = _ref.stopIndex, overscanStartIndex = void 0, overscanStopIndex = void 0;
- return scrollDirection === SCROLL_DIRECTION_FORWARD ? (overscanStartIndex = startIndex,
- overscanStopIndex = stopIndex + 2 * overscanCellsCount) : scrollDirection === SCROLL_DIRECTION_BACKWARD ? (overscanStartIndex = startIndex - 2 * overscanCellsCount,
- overscanStopIndex = stopIndex) : (overscanStartIndex = startIndex - overscanCellsCount,
- overscanStopIndex = stopIndex + overscanCellsCount), {
+ switch (scrollDirection) {
+ case SCROLL_DIRECTION_FORWARD:
+ overscanStartIndex = startIndex, overscanStopIndex = stopIndex + overscanCellsCount;
+ break;
+
+ case SCROLL_DIRECTION_BACKWARD:
+ overscanStartIndex = startIndex - overscanCellsCount, overscanStopIndex = stopIndex;
+ }
+ return {
overscanStartIndex: Math.max(0, overscanStartIndex),
overscanStopIndex: Math.min(cellCount - 1, overscanStopIndex)
};
}
Object.defineProperty(exports, "__esModule", {
value: !0
- }), exports.default = getOverscanIndices;
- var SCROLL_DIRECTION_BACKWARD = exports.SCROLL_DIRECTION_BACKWARD = -1, SCROLL_DIRECTION_FORWARD = (exports.SCROLL_DIRECTION_FIXED = 0,
- exports.SCROLL_DIRECTION_FORWARD = 1);
- }, /* 126 */
+ }), exports.default = defaultOverscanIndicesGetter;
+ var SCROLL_DIRECTION_BACKWARD = exports.SCROLL_DIRECTION_BACKWARD = -1, SCROLL_DIRECTION_FORWARD = exports.SCROLL_DIRECTION_FORWARD = 1;
+ }, /* 134 */
/***/
function(module, exports) {
"use strict";
function updateScrollIndexHelper(_ref) {
var cellSize = _ref.cellSize, cellSizeAndPositionManager = _ref.cellSizeAndPositionManager, previousCellsCount = _ref.previousCellsCount, previousCellSize = _ref.previousCellSize, previousScrollToAlignment = _ref.previousScrollToAlignment, previousScrollToIndex = _ref.previousScrollToIndex, previousSize = _ref.previousSize, scrollOffset = _ref.scrollOffset, scrollToAlignment = _ref.scrollToAlignment, scrollToIndex = _ref.scrollToIndex, size = _ref.size, updateScrollIndexCallback = _ref.updateScrollIndexCallback, cellCount = cellSizeAndPositionManager.getCellCount(), hasScrollToIndex = scrollToIndex >= 0 && scrollToIndex < cellCount, sizeHasChanged = size !== previousSize || !previousCellSize || "number" == typeof cellSize && cellSize !== previousCellSize;
hasScrollToIndex && (sizeHasChanged || scrollToAlignment !== previousScrollToAlignment || scrollToIndex !== previousScrollToIndex) ? updateScrollIndexCallback(scrollToIndex) : !hasScrollToIndex && cellCount > 0 && (size < previousSize || cellCount < previousCellsCount) && scrollOffset > cellSizeAndPositionManager.getTotalSize() - size && updateScrollIndexCallback(cellCount - 1);
}
Object.defineProperty(exports, "__esModule", {
value: !0
}), exports.default = updateScrollIndexHelper;
- }, /* 127 */
- /***/
- function(module, exports) {
- "use strict";
- function defaultCellRangeRenderer(_ref) {
- for (var cellCache = _ref.cellCache, cellRenderer = _ref.cellRenderer, columnSizeAndPositionManager = _ref.columnSizeAndPositionManager, columnStartIndex = _ref.columnStartIndex, columnStopIndex = _ref.columnStopIndex, horizontalOffsetAdjustment = _ref.horizontalOffsetAdjustment, isScrolling = _ref.isScrolling, rowSizeAndPositionManager = _ref.rowSizeAndPositionManager, rowStartIndex = _ref.rowStartIndex, rowStopIndex = _ref.rowStopIndex, verticalOffsetAdjustment = (_ref.scrollLeft,
- _ref.scrollTop, _ref.verticalOffsetAdjustment), visibleColumnIndices = _ref.visibleColumnIndices, visibleRowIndices = _ref.visibleRowIndices, renderedCells = [], rowIndex = rowStartIndex; rowIndex <= rowStopIndex; rowIndex++) for (var rowDatum = rowSizeAndPositionManager.getSizeAndPositionOfCell(rowIndex), columnIndex = columnStartIndex; columnIndex <= columnStopIndex; columnIndex++) {
- var columnDatum = columnSizeAndPositionManager.getSizeAndPositionOfCell(columnIndex), isVisible = columnIndex >= visibleColumnIndices.start && columnIndex <= visibleColumnIndices.stop && rowIndex >= visibleRowIndices.start && rowIndex <= visibleRowIndices.stop, key = rowIndex + "-" + columnIndex, style = {
- height: rowDatum.size,
- left: columnDatum.offset + horizontalOffsetAdjustment,
- position: "absolute",
- top: rowDatum.offset + verticalOffsetAdjustment,
- width: columnDatum.size
- }, cellRendererParams = {
- columnIndex: columnIndex,
- isScrolling: isScrolling,
- isVisible: isVisible,
- key: key,
- rowIndex: rowIndex,
- style: style
- }, renderedCell = void 0;
- !isScrolling || horizontalOffsetAdjustment || verticalOffsetAdjustment ? renderedCell = cellRenderer(cellRendererParams) : (cellCache[key] || (cellCache[key] = cellRenderer(cellRendererParams)),
- renderedCell = cellCache[key]), null != renderedCell && renderedCell !== !1 && renderedCells.push(renderedCell);
- }
- return renderedCells;
- }
- Object.defineProperty(exports, "__esModule", {
- value: !0
- }), exports.default = defaultCellRangeRenderer;
- }, /* 128 */
- /***/
- function(module, exports, __webpack_require__) {
- "use strict";
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- default: obj
- };
- }
- Object.defineProperty(exports, "__esModule", {
- value: !0
- }), exports.SortIndicator = exports.SortDirection = exports.Column = exports.Table = exports.defaultRowRenderer = exports.defaultHeaderRenderer = exports.defaultCellRenderer = exports.defaultCellDataGetter = exports.default = void 0;
- var _Table2 = __webpack_require__(129), _Table3 = _interopRequireDefault(_Table2), _defaultCellDataGetter2 = __webpack_require__(135), _defaultCellDataGetter3 = _interopRequireDefault(_defaultCellDataGetter2), _defaultCellRenderer2 = __webpack_require__(134), _defaultCellRenderer3 = _interopRequireDefault(_defaultCellRenderer2), _defaultHeaderRenderer2 = __webpack_require__(131), _defaultHeaderRenderer3 = _interopRequireDefault(_defaultHeaderRenderer2), _defaultRowRenderer2 = __webpack_require__(136), _defaultRowRenderer3 = _interopRequireDefault(_defaultRowRenderer2), _Column2 = __webpack_require__(130), _Column3 = _interopRequireDefault(_Column2), _SortDirection2 = __webpack_require__(133), _SortDirection3 = _interopRequireDefault(_SortDirection2), _SortIndicator2 = __webpack_require__(132), _SortIndicator3 = _interopRequireDefault(_SortIndicator2);
- exports.default = _Table3.default, exports.defaultCellDataGetter = _defaultCellDataGetter3.default,
- exports.defaultCellRenderer = _defaultCellRenderer3.default, exports.defaultHeaderRenderer = _defaultHeaderRenderer3.default,
- exports.defaultRowRenderer = _defaultRowRenderer3.default, exports.Table = _Table3.default,
- exports.Column = _Column3.default, exports.SortDirection = _SortDirection3.default,
- exports.SortIndicator = _SortIndicator3.default;
- }, /* 129 */
+ }, /* 135 */
/***/
function(module, exports, __webpack_require__) {
- "use strict";
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- default: obj
- };
- }
- Object.defineProperty(exports, "__esModule", {
- value: !0
- });
- var _extends2 = __webpack_require__(100), _extends3 = _interopRequireDefault(_extends2), _getPrototypeOf = __webpack_require__(3), _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf), _classCallCheck2 = __webpack_require__(29), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _createClass2 = __webpack_require__(30), _createClass3 = _interopRequireDefault(_createClass2), _possibleConstructorReturn2 = __webpack_require__(34), _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2), _inherits2 = __webpack_require__(81), _inherits3 = _interopRequireDefault(_inherits2), _classnames = __webpack_require__(107), _classnames2 = _interopRequireDefault(_classnames), _Column = __webpack_require__(130), _react = (_interopRequireDefault(_Column),
- __webpack_require__(89)), _react2 = _interopRequireDefault(_react), _reactDom = __webpack_require__(96), _reactAddonsShallowCompare = __webpack_require__(90), _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare), _Grid = __webpack_require__(120), _Grid2 = _interopRequireDefault(_Grid), _defaultRowRenderer = __webpack_require__(136), _defaultRowRenderer2 = _interopRequireDefault(_defaultRowRenderer), _SortDirection = __webpack_require__(133), _SortDirection2 = _interopRequireDefault(_SortDirection), Table = function(_Component) {
- function Table(props) {
- (0, _classCallCheck3.default)(this, Table);
- var _this = (0, _possibleConstructorReturn3.default)(this, (Table.__proto__ || (0,
- _getPrototypeOf2.default)(Table)).call(this, props));
- return _this.state = {
- scrollbarWidth: 0
- }, _this._createColumn = _this._createColumn.bind(_this), _this._createRow = _this._createRow.bind(_this),
- _this._onScroll = _this._onScroll.bind(_this), _this._onSectionRendered = _this._onSectionRendered.bind(_this),
- _this;
- }
- return (0, _inherits3.default)(Table, _Component), (0, _createClass3.default)(Table, [ {
- key: "forceUpdateGrid",
- value: function() {
- this.Grid.forceUpdate();
- }
- }, {
- key: "measureAllRows",
- value: function() {
- this.Grid.measureAllCells();
- }
- }, {
- key: "recomputeRowHeights",
- value: function() {
- var index = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0;
- this.Grid.recomputeGridSize({
- rowIndex: index
- }), this.forceUpdateGrid();
- }
- }, {
- key: "componentDidMount",
- value: function() {
- this._setScrollbarWidth();
- }
- }, {
- key: "componentDidUpdate",
- value: function() {
- this._setScrollbarWidth();
- }
- }, {
- key: "render",
- value: function() {
- var _this2 = this, _props = this.props, children = _props.children, className = _props.className, disableHeader = _props.disableHeader, gridClassName = _props.gridClassName, gridStyle = _props.gridStyle, headerHeight = _props.headerHeight, height = _props.height, id = _props.id, noRowsRenderer = _props.noRowsRenderer, rowClassName = _props.rowClassName, rowStyle = _props.rowStyle, scrollToIndex = _props.scrollToIndex, style = _props.style, width = _props.width, scrollbarWidth = this.state.scrollbarWidth, availableRowsHeight = height - headerHeight, rowClass = rowClassName instanceof Function ? rowClassName({
- index: -1
- }) : rowClassName, rowStyleObject = rowStyle instanceof Function ? rowStyle({
- index: -1
- }) : rowStyle;
- return this._cachedColumnStyles = [], _react2.default.Children.toArray(children).forEach(function(column, index) {
- var flexStyles = _this2._getFlexStyleForColumn(column, column.props.style);
- _this2._cachedColumnStyles[index] = (0, _extends3.default)({}, flexStyles, {
- overflow: "hidden"
- });
- }), _react2.default.createElement("div", {
- className: (0, _classnames2.default)("ReactVirtualized__Table", className),
- id: id,
+ /* WEBPACK VAR INJECTION */
+ (function(process) {
+ "use strict";
+ function defaultCellRangeRenderer(_ref) {
+ for (var cellCache = _ref.cellCache, cellRenderer = _ref.cellRenderer, columnSizeAndPositionManager = _ref.columnSizeAndPositionManager, columnStartIndex = _ref.columnStartIndex, columnStopIndex = _ref.columnStopIndex, deferredMeasurementCache = _ref.deferredMeasurementCache, horizontalOffsetAdjustment = _ref.horizontalOffsetAdjustment, isScrolling = _ref.isScrolling, parent = _ref.parent, rowSizeAndPositionManager = _ref.rowSizeAndPositionManager, rowStartIndex = _ref.rowStartIndex, rowStopIndex = _ref.rowStopIndex, styleCache = (_ref.scrollLeft,
+ _ref.scrollTop, _ref.styleCache), verticalOffsetAdjustment = _ref.verticalOffsetAdjustment, visibleColumnIndices = _ref.visibleColumnIndices, visibleRowIndices = _ref.visibleRowIndices, deferredMode = "undefined" != typeof deferredMeasurementCache, renderedCells = [], areOffsetsAdjusted = columnSizeAndPositionManager.areOffsetsAdjusted() || rowSizeAndPositionManager.areOffsetsAdjusted(), canCacheStyle = !isScrolling || !areOffsetsAdjusted, rowIndex = rowStartIndex; rowIndex <= rowStopIndex; rowIndex++) for (var rowDatum = rowSizeAndPositionManager.getSizeAndPositionOfCell(rowIndex), columnIndex = columnStartIndex; columnIndex <= columnStopIndex; columnIndex++) {
+ var columnDatum = columnSizeAndPositionManager.getSizeAndPositionOfCell(columnIndex), isVisible = columnIndex >= visibleColumnIndices.start && columnIndex <= visibleColumnIndices.stop && rowIndex >= visibleRowIndices.start && rowIndex <= visibleRowIndices.stop, key = rowIndex + "-" + columnIndex, style = void 0;
+ canCacheStyle && styleCache[key] ? style = styleCache[key] : deferredMode && !deferredMeasurementCache.has(rowIndex, columnIndex) ? style = {
+ height: "auto",
+ left: 0,
+ position: "absolute",
+ top: 0,
+ width: "auto"
+ } : (style = {
+ height: rowDatum.size,
+ left: columnDatum.offset + horizontalOffsetAdjustment,
+ position: "absolute",
+ top: rowDatum.offset + verticalOffsetAdjustment,
+ width: columnDatum.size
+ }, styleCache[key] = style);
+ var cellRendererParams = {
+ columnIndex: columnIndex,
+ isScrolling: isScrolling,
+ isVisible: isVisible,
+ key: key,
+ parent: parent,
+ rowIndex: rowIndex,
style: style
- }, !disableHeader && _react2.default.createElement("div", {
- className: (0, _classnames2.default)("ReactVirtualized__Table__headerRow", rowClass),
- style: (0, _extends3.default)({}, rowStyleObject, {
- height: headerHeight,
- overflow: "hidden",
- paddingRight: scrollbarWidth,
- width: width
- })
- }, this._getRenderedHeaderRow()), _react2.default.createElement(_Grid2.default, (0,
- _extends3.default)({}, this.props, {
- autoContainerWidth: !0,
- className: (0, _classnames2.default)("ReactVirtualized__Table__Grid", gridClassName),
- cellRenderer: this._createRow,
- columnWidth: width,
- columnCount: 1,
- height: availableRowsHeight,
- id: void 0,
- noContentRenderer: noRowsRenderer,
- onScroll: this._onScroll,
- onSectionRendered: this._onSectionRendered,
- ref: function(_ref) {
- _this2.Grid = _ref;
- },
- scrollbarWidth: scrollbarWidth,
- scrollToRow: scrollToIndex,
- style: (0, _extends3.default)({}, gridStyle, {
- overflowX: "hidden"
- })
- })));
- }
- }, {
- key: "shouldComponentUpdate",
- value: function(nextProps, nextState) {
- return (0, _reactAddonsShallowCompare2.default)(this, nextProps, nextState);
- }
- }, {
- key: "_createColumn",
- value: function(_ref2) {
- var column = _ref2.column, columnIndex = _ref2.columnIndex, isScrolling = _ref2.isScrolling, rowData = _ref2.rowData, rowIndex = _ref2.rowIndex, _column$props = column.props, cellDataGetter = _column$props.cellDataGetter, cellRenderer = _column$props.cellRenderer, className = _column$props.className, columnData = _column$props.columnData, dataKey = _column$props.dataKey, cellData = cellDataGetter({
- columnData: columnData,
- dataKey: dataKey,
- rowData: rowData
- }), renderedCell = cellRenderer({
- cellData: cellData,
- columnData: columnData,
- dataKey: dataKey,
- isScrolling: isScrolling,
- rowData: rowData,
- rowIndex: rowIndex
- }), style = this._cachedColumnStyles[columnIndex], title = "string" == typeof renderedCell ? renderedCell : null;
- return _react2.default.createElement("div", {
- key: "Row" + rowIndex + "-Col" + columnIndex,
- className: (0, _classnames2.default)("ReactVirtualized__Table__rowColumn", className),
- style: style,
- title: title
- }, renderedCell);
- }
- }, {
- key: "_createHeader",
- value: function(_ref3) {
- var column = _ref3.column, index = _ref3.index, _props2 = this.props, headerClassName = _props2.headerClassName, headerStyle = _props2.headerStyle, onHeaderClick = _props2.onHeaderClick, sort = _props2.sort, sortBy = _props2.sortBy, sortDirection = _props2.sortDirection, _column$props2 = column.props, dataKey = _column$props2.dataKey, disableSort = _column$props2.disableSort, headerRenderer = _column$props2.headerRenderer, label = _column$props2.label, columnData = _column$props2.columnData, sortEnabled = !disableSort && sort, classNames = (0,
- _classnames2.default)("ReactVirtualized__Table__headerColumn", headerClassName, column.props.headerClassName, {
- ReactVirtualized__Table__sortableHeaderColumn: sortEnabled
- }), style = this._getFlexStyleForColumn(column, headerStyle), renderedHeader = headerRenderer({
- columnData: columnData,
- dataKey: dataKey,
- disableSort: disableSort,
- label: label,
- sortBy: sortBy,
- sortDirection: sortDirection
- }), a11yProps = {};
- return (sortEnabled || onHeaderClick) && !function() {
- var newSortDirection = sortBy !== dataKey || sortDirection === _SortDirection2.default.DESC ? _SortDirection2.default.ASC : _SortDirection2.default.DESC, onClick = function() {
- sortEnabled && sort({
- sortBy: dataKey,
- sortDirection: newSortDirection
- }), onHeaderClick && onHeaderClick({
- columnData: columnData,
- dataKey: dataKey
- });
- }, onKeyDown = function(event) {
- "Enter" !== event.key && " " !== event.key || onClick();
- };
- a11yProps["aria-label"] = column.props["aria-label"] || label || dataKey, a11yProps.role = "rowheader",
- a11yProps.tabIndex = 0, a11yProps.onClick = onClick, a11yProps.onKeyDown = onKeyDown;
- }(), _react2.default.createElement("div", (0, _extends3.default)({}, a11yProps, {
- key: "Header-Col" + index,
- className: classNames,
- style: style
- }), renderedHeader);
- }
- }, {
- key: "_createRow",
- value: function(_ref4) {
- var _this3 = this, index = _ref4.rowIndex, isScrolling = _ref4.isScrolling, key = _ref4.key, style = _ref4.style, _props3 = this.props, children = _props3.children, onRowClick = _props3.onRowClick, onRowDoubleClick = _props3.onRowDoubleClick, onRowMouseOver = _props3.onRowMouseOver, onRowMouseOut = _props3.onRowMouseOut, rowClassName = _props3.rowClassName, rowGetter = _props3.rowGetter, rowRenderer = _props3.rowRenderer, rowStyle = _props3.rowStyle, scrollbarWidth = this.state.scrollbarWidth, rowClass = rowClassName instanceof Function ? rowClassName({
- index: index
- }) : rowClassName, rowStyleObject = rowStyle instanceof Function ? rowStyle({
- index: index
- }) : rowStyle, rowData = rowGetter({
- index: index
- }), columns = _react2.default.Children.toArray(children).map(function(column, columnIndex) {
- return _this3._createColumn({
- column: column,
- columnIndex: columnIndex,
- isScrolling: isScrolling,
- rowData: rowData,
- rowIndex: index,
- scrollbarWidth: scrollbarWidth
- });
- }), className = (0, _classnames2.default)("ReactVirtualized__Table__row", rowClass), flattenedStyle = (0,
- _extends3.default)({}, style, rowStyleObject, {
- height: this._getRowHeight(index),
- overflow: "hidden",
- paddingRight: scrollbarWidth
- });
- return rowRenderer({
- className: className,
- columns: columns,
- index: index,
- isScrolling: isScrolling,
- key: key,
- onRowClick: onRowClick,
- onRowDoubleClick: onRowDoubleClick,
- onRowMouseOver: onRowMouseOver,
- onRowMouseOut: onRowMouseOut,
- rowData: rowData,
- style: flattenedStyle
- });
+ }, renderedCell = void 0;
+ !isScrolling || horizontalOffsetAdjustment || verticalOffsetAdjustment ? renderedCell = cellRenderer(cellRendererParams) : (cellCache[key] || (cellCache[key] = cellRenderer(cellRendererParams)),
+ renderedCell = cellCache[key]), null != renderedCell && renderedCell !== !1 && ("production" !== process.env.NODE_ENV && warnAboutMissingStyle(parent, renderedCell),
+ renderedCells.push(renderedCell));
}
- }, {
- key: "_getFlexStyleForColumn",
- value: function(column) {
- var customStyle = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, flexValue = column.props.flexGrow + " " + column.props.flexShrink + " " + column.props.width + "px", style = (0,
- _extends3.default)({}, customStyle, {
- flex: flexValue,
- msFlex: flexValue,
- WebkitFlex: flexValue
- });
- return column.props.maxWidth && (style.maxWidth = column.props.maxWidth), column.props.minWidth && (style.minWidth = column.props.minWidth),
- style;
- }
- }, {
- key: "_getRenderedHeaderRow",
- value: function() {
- var _this4 = this, _props4 = this.props, children = _props4.children, disableHeader = _props4.disableHeader, items = disableHeader ? [] : _react2.default.Children.toArray(children);
- return items.map(function(column, index) {
- return _this4._createHeader({
- column: column,
- index: index
- });
- });
- }
- }, {
- key: "_getRowHeight",
- value: function(rowIndex) {
- var rowHeight = this.props.rowHeight;
- return rowHeight instanceof Function ? rowHeight({
- index: rowIndex
- }) : rowHeight;
- }
- }, {
- key: "_onScroll",
- value: function(_ref5) {
- var clientHeight = _ref5.clientHeight, scrollHeight = _ref5.scrollHeight, scrollTop = _ref5.scrollTop, onScroll = this.props.onScroll;
- onScroll({
- clientHeight: clientHeight,
- scrollHeight: scrollHeight,
- scrollTop: scrollTop
- });
- }
- }, {
- key: "_onSectionRendered",
- value: function(_ref6) {
- var rowOverscanStartIndex = _ref6.rowOverscanStartIndex, rowOverscanStopIndex = _ref6.rowOverscanStopIndex, rowStartIndex = _ref6.rowStartIndex, rowStopIndex = _ref6.rowStopIndex, onRowsRendered = this.props.onRowsRendered;
- onRowsRendered({
- overscanStartIndex: rowOverscanStartIndex,
- overscanStopIndex: rowOverscanStopIndex,
- startIndex: rowStartIndex,
- stopIndex: rowStopIndex
- });
- }
- }, {
- key: "_setScrollbarWidth",
- value: function() {
- var Grid = (0, _reactDom.findDOMNode)(this.Grid), clientWidth = Grid.clientWidth || 0, offsetWidth = Grid.offsetWidth || 0, scrollbarWidth = offsetWidth - clientWidth;
- this.setState({
- scrollbarWidth: scrollbarWidth
- });
- }
- } ]), Table;
- }(_react.Component);
- Table.defaultProps = {
- disableHeader: !1,
- estimatedRowSize: 30,
- headerHeight: 0,
- headerStyle: {},
- noRowsRenderer: function() {
- return null;
- },
- onRowsRendered: function() {
- return null;
- },
- onScroll: function() {
- return null;
- },
- overscanRowCount: 10,
- rowRenderer: _defaultRowRenderer2.default,
- rowStyle: {},
- scrollToAlignment: "auto",
- style: {}
- }, exports.default = Table;
- }, /* 130 */
- /***/
- function(module, exports, __webpack_require__) {
- "use strict";
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- default: obj
- };
- }
- Object.defineProperty(exports, "__esModule", {
- value: !0
- });
- var _getPrototypeOf = __webpack_require__(3), _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf), _classCallCheck2 = __webpack_require__(29), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _possibleConstructorReturn2 = __webpack_require__(34), _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2), _inherits2 = __webpack_require__(81), _inherits3 = _interopRequireDefault(_inherits2), _react = __webpack_require__(89), _defaultHeaderRenderer = __webpack_require__(131), _defaultHeaderRenderer2 = _interopRequireDefault(_defaultHeaderRenderer), _defaultCellRenderer = __webpack_require__(134), _defaultCellRenderer2 = _interopRequireDefault(_defaultCellRenderer), _defaultCellDataGetter = __webpack_require__(135), _defaultCellDataGetter2 = _interopRequireDefault(_defaultCellDataGetter), Column = function(_Component) {
- function Column() {
- return (0, _classCallCheck3.default)(this, Column), (0, _possibleConstructorReturn3.default)(this, (Column.__proto__ || (0,
- _getPrototypeOf2.default)(Column)).apply(this, arguments));
+ return renderedCells;
}
- return (0, _inherits3.default)(Column, _Component), Column;
- }(_react.Component);
- Column.defaultProps = {
- cellDataGetter: _defaultCellDataGetter2.default,
- cellRenderer: _defaultCellRenderer2.default,
- flexGrow: 0,
- flexShrink: 1,
- headerRenderer: _defaultHeaderRenderer2.default,
- style: {}
- }, exports.default = Column;
- }, /* 131 */
- /***/
- function(module, exports, __webpack_require__) {
- "use strict";
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- default: obj
- };
- }
- function defaultHeaderRenderer(_ref) {
- var dataKey = (_ref.columnData, _ref.dataKey), label = (_ref.disableSort, _ref.label), sortBy = _ref.sortBy, sortDirection = _ref.sortDirection, showSortIndicator = sortBy === dataKey, children = [ _react2.default.createElement("span", {
- className: "ReactVirtualized__Table__headerTruncatedText",
- key: "label",
- title: label
- }, label) ];
- return showSortIndicator && children.push(_react2.default.createElement(_SortIndicator2.default, {
- key: "SortIndicator",
- sortDirection: sortDirection
- })), children;
- }
- Object.defineProperty(exports, "__esModule", {
- value: !0
- }), exports.default = defaultHeaderRenderer;
- var _react = __webpack_require__(89), _react2 = _interopRequireDefault(_react), _SortIndicator = __webpack_require__(132), _SortIndicator2 = _interopRequireDefault(_SortIndicator);
- }, /* 132 */
- /***/
- function(module, exports, __webpack_require__) {
- "use strict";
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- default: obj
- };
- }
- function SortIndicator(_ref) {
- var sortDirection = _ref.sortDirection, classNames = (0, _classnames2.default)("ReactVirtualized__Table__sortableHeaderIcon", {
- "ReactVirtualized__Table__sortableHeaderIcon--ASC": sortDirection === _SortDirection2.default.ASC,
- "ReactVirtualized__Table__sortableHeaderIcon--DESC": sortDirection === _SortDirection2.default.DESC
- });
- return _react2.default.createElement("svg", {
- className: classNames,
- width: 18,
- height: 18,
- viewBox: "0 0 24 24"
- }, sortDirection === _SortDirection2.default.ASC ? _react2.default.createElement("path", {
- d: "M7 14l5-5 5 5z"
- }) : _react2.default.createElement("path", {
- d: "M7 10l5 5 5-5z"
- }), _react2.default.createElement("path", {
- d: "M0 0h24v24H0z",
- fill: "none"
- }));
- }
- Object.defineProperty(exports, "__esModule", {
- value: !0
- }), exports.default = SortIndicator;
- var _react = __webpack_require__(89), _react2 = _interopRequireDefault(_react), _classnames = __webpack_require__(107), _classnames2 = _interopRequireDefault(_classnames), _SortDirection = __webpack_require__(133), _SortDirection2 = _interopRequireDefault(_SortDirection);
- }, /* 133 */
- /***/
- function(module, exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: !0
- });
- var SortDirection = {
- ASC: "ASC",
- DESC: "DESC"
- };
- exports.default = SortDirection;
- }, /* 134 */
- /***/
- function(module, exports) {
- "use strict";
- function defaultCellRenderer(_ref) {
- var cellData = _ref.cellData;
- _ref.cellDataKey, _ref.columnData, _ref.rowData, _ref.rowIndex;
- return null == cellData ? "" : String(cellData);
- }
- Object.defineProperty(exports, "__esModule", {
- value: !0
- }), exports.default = defaultCellRenderer;
- }, /* 135 */
- /***/
- function(module, exports) {
- "use strict";
- function defaultCellDataGetter(_ref) {
- var dataKey = (_ref.columnData, _ref.dataKey), rowData = _ref.rowData;
- return rowData.get instanceof Function ? rowData.get(dataKey) : rowData[dataKey];
- }
- Object.defineProperty(exports, "__esModule", {
- value: !0
- }), exports.default = defaultCellDataGetter;
+ function warnAboutMissingStyle(parent, renderedCell) {
+ "production" !== process.env.NODE_ENV && renderedCell && void 0 === renderedCell.props.style && parent.__warnedAboutMissingStyle !== !0 && (parent.__warnedAboutMissingStyle = !0,
+ console.warn("Rendered cell should include style property for positioning."));
+ }
+ Object.defineProperty(exports, "__esModule", {
+ value: !0
+ }), exports.default = defaultCellRangeRenderer;
+ }).call(exports, __webpack_require__(95));
}, /* 136 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function defaultRowRenderer(_ref) {
var className = _ref.className, columns = _ref.columns, index = _ref.index, key = (_ref.isScrolling,
- _ref.key), onRowClick = _ref.onRowClick, onRowDoubleClick = _ref.onRowDoubleClick, onRowMouseOver = _ref.onRowMouseOver, onRowMouseOut = _ref.onRowMouseOut, style = (_ref.rowData,
- _ref.style), a11yProps = {};
+ _ref.key), onRowClick = _ref.onRowClick, onRowDoubleClick = _ref.onRowDoubleClick, onRowMouseOver = _ref.onRowMouseOver, onRowMouseOut = _ref.onRowMouseOut, rowData = _ref.rowData, style = _ref.style, a11yProps = {};
return (onRowClick || onRowDoubleClick || onRowMouseOver || onRowMouseOut) && (a11yProps["aria-label"] = "row",
a11yProps.role = "row", a11yProps.tabIndex = 0, onRowClick && (a11yProps.onClick = function() {
return onRowClick({
- index: index
+ index: index,
+ rowData: rowData
});
}), onRowDoubleClick && (a11yProps.onDoubleClick = function() {
return onRowDoubleClick({
- index: index
+ index: index,
+ rowData: rowData
});
}), onRowMouseOut && (a11yProps.onMouseOut = function() {
return onRowMouseOut({
- index: index
+ index: index,
+ rowData: rowData
});
}), onRowMouseOver && (a11yProps.onMouseOver = function() {
return onRowMouseOver({
- index: index
+ index: index,
+ rowData: rowData
});
})), _react2.default.createElement("div", (0, _extends3.default)({}, a11yProps, {
className: className,
key: key,
style: style
}), columns);
}
Object.defineProperty(exports, "__esModule", {
@@ -3862,47 +4065,43 @@ var REACT_SHALLOW_COMPARE = "devtools/cl
if (isRowLoaded({
index: _index2
})) break;
firstUnloadedRange.startIndex = _index2;
}
return unloadedRanges;
}
function forceUpdateReactVirtualizedComponent(component) {
- "function" == typeof component.forceUpdateGrid ? component.forceUpdateGrid() : component.forceUpdate();
+ var recomputeSize = "function" == typeof component.recomputeGridSize ? component.recomputeGridSize : component.recomputeRowHeights;
+ recomputeSize ? recomputeSize.call(component) : component.forceUpdate();
}
Object.defineProperty(exports, "__esModule", {
value: !0
});
var _getPrototypeOf = __webpack_require__(3), _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf), _classCallCheck2 = __webpack_require__(29), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _createClass2 = __webpack_require__(30), _createClass3 = _interopRequireDefault(_createClass2), _possibleConstructorReturn2 = __webpack_require__(34), _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2), _inherits2 = __webpack_require__(81), _inherits3 = _interopRequireDefault(_inherits2);
exports.isRangeVisible = isRangeVisible, exports.scanForUnloadedRanges = scanForUnloadedRanges,
exports.forceUpdateReactVirtualizedComponent = forceUpdateReactVirtualizedComponent;
- var _react = __webpack_require__(89), _reactAddonsShallowCompare = __webpack_require__(90), _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare), _createCallbackMemoizer = __webpack_require__(108), _createCallbackMemoizer2 = _interopRequireDefault(_createCallbackMemoizer), InfiniteLoader = function(_Component) {
+ var _react = __webpack_require__(89), _createCallbackMemoizer = __webpack_require__(108), _createCallbackMemoizer2 = _interopRequireDefault(_createCallbackMemoizer), InfiniteLoader = function(_PureComponent) {
function InfiniteLoader(props, context) {
(0, _classCallCheck3.default)(this, InfiniteLoader);
var _this = (0, _possibleConstructorReturn3.default)(this, (InfiniteLoader.__proto__ || (0,
_getPrototypeOf2.default)(InfiniteLoader)).call(this, props, context));
return _this._loadMoreRowsMemoizer = (0, _createCallbackMemoizer2.default)(), _this._onRowsRendered = _this._onRowsRendered.bind(_this),
_this._registerChild = _this._registerChild.bind(_this), _this;
}
- return (0, _inherits3.default)(InfiniteLoader, _Component), (0, _createClass3.default)(InfiniteLoader, [ {
+ return (0, _inherits3.default)(InfiniteLoader, _PureComponent), (0, _createClass3.default)(InfiniteLoader, [ {
key: "render",
value: function() {
var children = this.props.children;
return children({
onRowsRendered: this._onRowsRendered,
registerChild: this._registerChild
});
}
}, {
- key: "shouldComponentUpdate",
- value: function(nextProps, nextState) {
- return (0, _reactAddonsShallowCompare2.default)(this, nextProps, nextState);
- }
- }, {
key: "_loadUnloadedRanges",
value: function(unloadedRanges) {
var _this2 = this, loadMoreRows = this.props.loadMoreRows;
unloadedRanges.forEach(function(unloadedRange) {
var promise = loadMoreRows(unloadedRange);
promise && promise.then(function() {
isRangeVisible({
lastRenderedStartIndex: _this2._lastRenderedStartIndex,
@@ -3937,360 +4136,766 @@ var REACT_SHALLOW_COMPARE = "devtools/cl
});
}
}, {
key: "_registerChild",
value: function(registeredChild) {
this._registeredChild = registeredChild;
}
} ]), InfiniteLoader;
- }(_react.Component);
+ }(_react.PureComponent);
InfiniteLoader.defaultProps = {
minimumBatchSize: 10,
rowCount: 0,
threshold: 15
}, exports.default = InfiniteLoader;
}, /* 139 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
Object.defineProperty(exports, "__esModule", {
value: !0
- }), exports.ScrollSync = exports.default = void 0;
- var _ScrollSync2 = __webpack_require__(140), _ScrollSync3 = _interopRequireDefault(_ScrollSync2);
- exports.default = _ScrollSync3.default, exports.ScrollSync = _ScrollSync3.default;
+ }), exports.List = exports.default = void 0;
+ var _List2 = __webpack_require__(140), _List3 = _interopRequireDefault(_List2);
+ exports.default = _List3.default, exports.List = _List3.default;
}, /* 140 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
Object.defineProperty(exports, "__esModule", {
value: !0
});
- var _getPrototypeOf = __webpack_require__(3), _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf), _classCallCheck2 = __webpack_require__(29), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _createClass2 = __webpack_require__(30), _createClass3 = _interopRequireDefault(_createClass2), _possibleConstructorReturn2 = __webpack_require__(34), _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2), _inherits2 = __webpack_require__(81), _inherits3 = _interopRequireDefault(_inherits2), _react = __webpack_require__(89), _reactAddonsShallowCompare = __webpack_require__(90), _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare), ScrollSync = function(_Component) {
- function ScrollSync(props, context) {
- (0, _classCallCheck3.default)(this, ScrollSync);
- var _this = (0, _possibleConstructorReturn3.default)(this, (ScrollSync.__proto__ || (0,
- _getPrototypeOf2.default)(ScrollSync)).call(this, props, context));
- return _this.state = {
- clientHeight: 0,
- clientWidth: 0,
- scrollHeight: 0,
- scrollLeft: 0,
- scrollTop: 0,
- scrollWidth: 0
- }, _this._onScroll = _this._onScroll.bind(_this), _this;
- }
- return (0, _inherits3.default)(ScrollSync, _Component), (0, _createClass3.default)(ScrollSync, [ {
- key: "render",
- value: function() {
- var children = this.props.children, _state = this.state, clientHeight = _state.clientHeight, clientWidth = _state.clientWidth, scrollHeight = _state.scrollHeight, scrollLeft = _state.scrollLeft, scrollTop = _state.scrollTop, scrollWidth = _state.scrollWidth;
- return children({
- clientHeight: clientHeight,
- clientWidth: clientWidth,
- onScroll: this._onScroll,
- scrollHeight: scrollHeight,
- scrollLeft: scrollLeft,
- scrollTop: scrollTop,
- scrollWidth: scrollWidth
- });
- }
- }, {
- key: "shouldComponentUpdate",
- value: function(nextProps, nextState) {
- return (0, _reactAddonsShallowCompare2.default)(this, nextProps, nextState);
- }
- }, {
- key: "_onScroll",
- value: function(_ref) {
- var clientHeight = _ref.clientHeight, clientWidth = _ref.clientWidth, scrollHeight = _ref.scrollHeight, scrollLeft = _ref.scrollLeft, scrollTop = _ref.scrollTop, scrollWidth = _ref.scrollWidth;
- this.setState({
- clientHeight: clientHeight,
- clientWidth: clientWidth,
- scrollHeight: scrollHeight,
- scrollLeft: scrollLeft,
- scrollTop: scrollTop,
- scrollWidth: scrollWidth
- });
- }
- } ]), ScrollSync;
- }(_react.Component);
- exports.default = ScrollSync;
- }, /* 141 */
- /***/
- function(module, exports, __webpack_require__) {
- "use strict";
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- default: obj
- };
- }
- Object.defineProperty(exports, "__esModule", {
- value: !0
- }), exports.List = exports.default = void 0;
- var _List2 = __webpack_require__(142), _List3 = _interopRequireDefault(_List2);
- exports.default = _List3.default, exports.List = _List3.default;
- }, /* 142 */
- /***/
- function(module, exports, __webpack_require__) {
- "use strict";
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- default: obj
- };
- }
- Object.defineProperty(exports, "__esModule", {
- value: !0
- });
- var _objectWithoutProperties2 = __webpack_require__(105), _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2), _extends2 = __webpack_require__(100), _extends3 = _interopRequireDefault(_extends2), _getPrototypeOf = __webpack_require__(3), _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf), _classCallCheck2 = __webpack_require__(29), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _createClass2 = __webpack_require__(30), _createClass3 = _interopRequireDefault(_createClass2), _possibleConstructorReturn2 = __webpack_require__(34), _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2), _inherits2 = __webpack_require__(81), _inherits3 = _interopRequireDefault(_inherits2), _Grid = __webpack_require__(120), _Grid2 = _interopRequireDefault(_Grid), _react = __webpack_require__(89), _react2 = _interopRequireDefault(_react), _classnames = __webpack_require__(107), _classnames2 = _interopRequireDefault(_classnames), _reactAddonsShallowCompare = __webpack_require__(90), _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare), List = function(_Component) {
+ var _getOwnPropertyDescriptor = __webpack_require__(141), _getOwnPropertyDescriptor2 = _interopRequireDefault(_getOwnPropertyDescriptor), _objectWithoutProperties2 = __webpack_require__(105), _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2), _extends2 = __webpack_require__(100), _extends3 = _interopRequireDefault(_extends2), _getPrototypeOf = __webpack_require__(3), _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf), _classCallCheck2 = __webpack_require__(29), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _createClass2 = __webpack_require__(30), _createClass3 = _interopRequireDefault(_createClass2), _possibleConstructorReturn2 = __webpack_require__(34), _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2), _inherits2 = __webpack_require__(81), _inherits3 = _interopRequireDefault(_inherits2), _Grid = __webpack_require__(128), _Grid2 = _interopRequireDefault(_Grid), _react = __webpack_require__(89), _react2 = _interopRequireDefault(_react), _classnames = __webpack_require__(107), _classnames2 = _interopRequireDefault(_classnames), List = function(_PureComponent) {
function List(props, context) {
(0, _classCallCheck3.default)(this, List);
var _this = (0, _possibleConstructorReturn3.default)(this, (List.__proto__ || (0,
_getPrototypeOf2.default)(List)).call(this, props, context));
return _this._cellRenderer = _this._cellRenderer.bind(_this), _this._onScroll = _this._onScroll.bind(_this),
- _this._onSectionRendered = _this._onSectionRendered.bind(_this), _this;
+ _this._onSectionRendered = _this._onSectionRendered.bind(_this), _this._setRef = _this._setRef.bind(_this),
+ _this;
}
- return (0, _inherits3.default)(List, _Component), (0, _createClass3.default)(List, [ {
+ return (0, _inherits3.default)(List, _PureComponent), (0, _createClass3.default)(List, [ {
key: "forceUpdateGrid",
value: function() {
this.Grid.forceUpdate();
}
}, {
key: "measureAllRows",
value: function() {
this.Grid.measureAllCells();
}
}, {
key: "recomputeRowHeights",
value: function() {
var index = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0;
this.Grid.recomputeGridSize({
rowIndex: index
- }), this.forceUpdateGrid();
+ });
+ }
+ }, {
+ key: "scrollToRow",
+ value: function() {
+ var index = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0;
+ this.Grid.scrollToCell({
+ columnIndex: 0,
+ rowIndex: index
+ });
}
}, {
key: "render",
value: function() {
- var _this2 = this, _props = this.props, className = _props.className, noRowsRenderer = _props.noRowsRenderer, scrollToIndex = _props.scrollToIndex, width = _props.width, classNames = (0,
+ var _props = this.props, className = _props.className, noRowsRenderer = _props.noRowsRenderer, scrollToIndex = _props.scrollToIndex, width = _props.width, classNames = (0,
_classnames2.default)("ReactVirtualized__List", className);
return _react2.default.createElement(_Grid2.default, (0, _extends3.default)({}, this.props, {
autoContainerWidth: !0,
cellRenderer: this._cellRenderer,
className: classNames,
columnWidth: width,
columnCount: 1,
noContentRenderer: noRowsRenderer,
onScroll: this._onScroll,
onSectionRendered: this._onSectionRendered,
- ref: function(_ref) {
- _this2.Grid = _ref;
- },
+ ref: this._setRef,
scrollToRow: scrollToIndex
}));
}
}, {
- key: "shouldComponentUpdate",
- value: function(nextProps, nextState) {
- return (0, _reactAddonsShallowCompare2.default)(this, nextProps, nextState);
- }
- }, {
key: "_cellRenderer",
- value: function(_ref2) {
- var rowIndex = _ref2.rowIndex, style = _ref2.style, rest = (0, _objectWithoutProperties3.default)(_ref2, [ "rowIndex", "style" ]), rowRenderer = this.props.rowRenderer;
- return style.width = "100%", rowRenderer((0, _extends3.default)({
+ value: function(_ref) {
+ var rowIndex = _ref.rowIndex, style = _ref.style, rest = (0, _objectWithoutProperties3.default)(_ref, [ "rowIndex", "style" ]), rowRenderer = this.props.rowRenderer, _Object$getOwnPropert = (0,
+ _getOwnPropertyDescriptor2.default)(style, "width"), writable = _Object$getOwnPropert.writable;
+ return writable && (style.width = "100%"), rowRenderer((0, _extends3.default)({
index: rowIndex,
style: style
}, rest));
}
}, {
+ key: "_setRef",
+ value: function(ref) {
+ this.Grid = ref;
+ }
+ }, {
key: "_onScroll",
- value: function(_ref3) {
- var clientHeight = _ref3.clientHeight, scrollHeight = _ref3.scrollHeight, scrollTop = _ref3.scrollTop, onScroll = this.props.onScroll;
+ value: function(_ref2) {
+ var clientHeight = _ref2.clientHeight, scrollHeight = _ref2.scrollHeight, scrollTop = _ref2.scrollTop, onScroll = this.props.onScroll;
onScroll({
clientHeight: clientHeight,
scrollHeight: scrollHeight,
scrollTop: scrollTop
});
}
}, {
key: "_onSectionRendered",
- value: function(_ref4) {
- var rowOverscanStartIndex = _ref4.rowOverscanStartIndex, rowOverscanStopIndex = _ref4.rowOverscanStopIndex, rowStartIndex = _ref4.rowStartIndex, rowStopIndex = _ref4.rowStopIndex, onRowsRendered = this.props.onRowsRendered;
+ value: function(_ref3) {
+ var rowOverscanStartIndex = _ref3.rowOverscanStartIndex, rowOverscanStopIndex = _ref3.rowOverscanStopIndex, rowStartIndex = _ref3.rowStartIndex, rowStopIndex = _ref3.rowStopIndex, onRowsRendered = this.props.onRowsRendered;
onRowsRendered({
overscanStartIndex: rowOverscanStartIndex,
overscanStopIndex: rowOverscanStopIndex,
startIndex: rowStartIndex,
stopIndex: rowStopIndex
});
}
} ]), List;
- }(_react.Component);
+ }(_react.PureComponent);
List.defaultProps = {
estimatedRowSize: 30,
noRowsRenderer: function() {
return null;
},
onRowsRendered: function() {
return null;
},
onScroll: function() {
return null;
},
overscanRowCount: 10,
scrollToAlignment: "auto",
+ scrollToIndex: -1,
style: {}
}, exports.default = List;
+ }, /* 141 */
+ /***/
+ function(module, exports, __webpack_require__) {
+ module.exports = {
+ default: __webpack_require__(142),
+ __esModule: !0
+ };
+ }, /* 142 */
+ /***/
+ function(module, exports, __webpack_require__) {
+ __webpack_require__(143);
+ var $Object = __webpack_require__(16).Object;
+ module.exports = function(it, key) {
+ return $Object.getOwnPropertyDescriptor(it, key);
+ };
}, /* 143 */
/***/
function(module, exports, __webpack_require__) {
+ // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
+ var toIObject = __webpack_require__(50), $getOwnPropertyDescriptor = __webpack_require__(77).f;
+ __webpack_require__(14)("getOwnPropertyDescriptor", function() {
+ return function(it, key) {
+ return $getOwnPropertyDescriptor(toIObject(it), key);
+ };
+ });
+ }, /* 144 */
+ /***/
+ function(module, exports, __webpack_require__) {
"use strict";
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
Object.defineProperty(exports, "__esModule", {
value: !0
- }), exports.IS_SCROLLING_TIMEOUT = exports.WindowScroller = exports.default = void 0;
- var _onScroll = __webpack_require__(144);
- Object.defineProperty(exports, "IS_SCROLLING_TIMEOUT", {
- enumerable: !0,
- get: function() {
- return _onScroll.IS_SCROLLING_TIMEOUT;
- }
- });
- var _WindowScroller2 = __webpack_require__(145), _WindowScroller3 = _interopRequireDefault(_WindowScroller2);
- exports.default = _WindowScroller3.default, exports.WindowScroller = _WindowScroller3.default;
- }, /* 144 */
- /***/
- function(module, exports) {
- "use strict";
- function enablePointerEventsIfDisabled() {
- disablePointerEventsTimeoutId && (disablePointerEventsTimeoutId = null, document.firstElementChild.style.pointerEvents = originalBodyPointerEvents,
- originalBodyPointerEvents = null);
- }
- function enablePointerEventsAfterDelayCallback() {
- enablePointerEventsIfDisabled(), mountedInstances.forEach(function(component) {
- return component._enablePointerEventsAfterDelayCallback();
- });
- }
- function enablePointerEventsAfterDelay() {
- disablePointerEventsTimeoutId && clearTimeout(disablePointerEventsTimeoutId), disablePointerEventsTimeoutId = setTimeout(enablePointerEventsAfterDelayCallback, IS_SCROLLING_TIMEOUT);
- }
- function onScrollWindow(event) {
- null == originalBodyPointerEvents && (originalBodyPointerEvents = document.firstElementChild.style.pointerEvents,
- document.firstElementChild.style.pointerEvents = "none", enablePointerEventsAfterDelay()), mountedInstances.forEach(function(component) {
- return component._onScrollWindow(event);
- });
- }
- function registerScrollListener(component) {
- mountedInstances.length || window.addEventListener("scroll", onScrollWindow), mountedInstances.push(component);
- }
- function unregisterScrollListener(component) {
- mountedInstances = mountedInstances.filter(function(c) {
- return c !== component;
- }), mountedInstances.length || (window.removeEventListener("scroll", onScrollWindow),
- disablePointerEventsTimeoutId && (clearTimeout(disablePointerEventsTimeoutId), enablePointerEventsIfDisabled()));
- }
- Object.defineProperty(exports, "__esModule", {
- value: !0
- }), exports.registerScrollListener = registerScrollListener, exports.unregisterScrollListener = unregisterScrollListener;
- var mountedInstances = [], originalBodyPointerEvents = null, disablePointerEventsTimeoutId = null, IS_SCROLLING_TIMEOUT = exports.IS_SCROLLING_TIMEOUT = 150;
+ }), exports.MultiGrid = exports.default = void 0;
+ var _MultiGrid2 = __webpack_require__(145), _MultiGrid3 = _interopRequireDefault(_MultiGrid2);
+ exports.default = _MultiGrid3.default, exports.MultiGrid = _MultiGrid3.default;
}, /* 145 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
Object.defineProperty(exports, "__esModule", {
value: !0
});
- var _getPrototypeOf = __webpack_require__(3), _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf), _classCallCheck2 = __webpack_require__(29), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _createClass2 = __webpack_require__(30), _createClass3 = _interopRequireDefault(_createClass2), _possibleConstructorReturn2 = __webpack_require__(34), _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2), _inherits2 = __webpack_require__(81), _inherits3 = _interopRequireDefault(_inherits2), _react = __webpack_require__(89), _react2 = _interopRequireDefault(_react), _reactDom = __webpack_require__(96), _reactDom2 = _interopRequireDefault(_reactDom), _reactAddonsShallowCompare = __webpack_require__(90), _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare), _onScroll = __webpack_require__(144), WindowScroller = function(_Component) {
+ var _extends2 = __webpack_require__(100), _extends3 = _interopRequireDefault(_extends2), _objectWithoutProperties2 = __webpack_require__(105), _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2), _getPrototypeOf = __webpack_require__(3), _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf), _classCallCheck2 = __webpack_require__(29), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _createClass2 = __webpack_require__(30), _createClass3 = _interopRequireDefault(_createClass2), _possibleConstructorReturn2 = __webpack_require__(34), _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2), _inherits2 = __webpack_require__(81), _inherits3 = _interopRequireDefault(_inherits2), _react = __webpack_require__(89), _react2 = _interopRequireDefault(_react), _Grid = __webpack_require__(128), _Grid2 = _interopRequireDefault(_Grid), MultiGrid = function(_PureComponent) {
+ function MultiGrid(props, context) {
+ (0, _classCallCheck3.default)(this, MultiGrid);
+ var _this = (0, _possibleConstructorReturn3.default)(this, (MultiGrid.__proto__ || (0,
+ _getPrototypeOf2.default)(MultiGrid)).call(this, props, context));
+ return _this.state = {
+ scrollLeft: 0,
+ scrollTop: 0
+ }, _this._bottomLeftGridRef = _this._bottomLeftGridRef.bind(_this), _this._bottomRightGridRef = _this._bottomRightGridRef.bind(_this),
+ _this._cellRendererBottomLeftGrid = _this._cellRendererBottomLeftGrid.bind(_this),
+ _this._cellRendererBottomRightGrid = _this._cellRendererBottomRightGrid.bind(_this),
+ _this._cellRendererTopRightGrid = _this._cellRendererTopRightGrid.bind(_this), _this._columnWidthRightGrid = _this._columnWidthRightGrid.bind(_this),
+ _this._onScroll = _this._onScroll.bind(_this), _this._rowHeightBottomGrid = _this._rowHeightBottomGrid.bind(_this),
+ _this._topLeftGridRef = _this._topLeftGridRef.bind(_this), _this._topRightGridRef = _this._topRightGridRef.bind(_this),
+ _this;
+ }
+ return (0, _inherits3.default)(MultiGrid, _PureComponent), (0, _createClass3.default)(MultiGrid, [ {
+ key: "forceUpdateGrids",
+ value: function() {
+ this._bottomLeftGrid && this._bottomLeftGrid.forceUpdate(), this._bottomRightGrid && this._bottomRightGrid.forceUpdate(),
+ this._topLeftGrid && this._topLeftGrid.forceUpdate(), this._topRightGrid && this._topRightGrid.forceUpdate();
+ }
+ }, {
+ key: "measureAllCells",
+ value: function() {
+ this._bottomLeftGrid && this._bottomLeftGrid.measureAllCells(), this._bottomRightGrid && this._bottomRightGrid.measureAllCells(),
+ this._topLeftGrid && this._topLeftGrid.measureAllCells(), this._topRightGrid && this._topRightGrid.measureAllCells();
+ }
+ }, {
+ key: "recomputeGridSize",
+ value: function() {
+ var _ref = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, _ref$columnIndex = _ref.columnIndex, columnIndex = void 0 === _ref$columnIndex ? 0 : _ref$columnIndex, _ref$rowIndex = _ref.rowIndex, rowIndex = void 0 === _ref$rowIndex ? 0 : _ref$rowIndex, _props = this.props, fixedColumnCount = _props.fixedColumnCount, fixedRowCount = _props.fixedRowCount, adjustedColumnIndex = Math.max(0, columnIndex - fixedColumnCount), adjustedRowIndex = Math.max(0, rowIndex - fixedRowCount);
+ this._bottomLeftGrid && this._bottomLeftGrid.recomputeGridSize({
+ columnIndex: columnIndex,
+ rowIndex: adjustedRowIndex
+ }), this._bottomRightGrid && this._bottomRightGrid.recomputeGridSize({
+ columnIndex: adjustedColumnIndex,
+ rowIndex: adjustedRowIndex
+ }), this._topLeftGrid && this._topLeftGrid.recomputeGridSize({
+ columnIndex: columnIndex,
+ rowIndex: rowIndex
+ }), this._topRightGrid && this._topRightGrid.recomputeGridSize({
+ columnIndex: adjustedColumnIndex,
+ rowIndex: rowIndex
+ }), this._leftGridWidth = null, this._topGridHeight = null, this._maybeCalculateCachedStyles(null, this.props);
+ }
+ }, {
+ key: "componentWillMount",
+ value: function() {
+ this._maybeCalculateCachedStyles(null, this.props);
+ }
+ }, {
+ key: "componentWillReceiveProps",
+ value: function(nextProps) {
+ var _props2 = this.props, columnWidth = _props2.columnWidth, fixedColumnCount = _props2.fixedColumnCount, fixedRowCount = _props2.fixedRowCount, rowHeight = _props2.rowHeight;
+ columnWidth === nextProps.columnWidth && fixedColumnCount === nextProps.fixedColumnCount || (this._leftGridWidth = null),
+ fixedRowCount === nextProps.fixedRowCount && rowHeight === nextProps.rowHeight || (this._topGridHeight = null),
+ this._maybeCalculateCachedStyles(this.props, nextProps);
+ }
+ }, {
+ key: "render",
+ value: function() {
+ var _props3 = this.props, onScroll = _props3.onScroll, onSectionRendered = _props3.onSectionRendered, scrollToColumn = (_props3.scrollLeft,
+ _props3.scrollToColumn), scrollToRow = (_props3.scrollTop, _props3.scrollToRow), rest = (0,
+ _objectWithoutProperties3.default)(_props3, [ "onScroll", "onSectionRendered", "scrollLeft", "scrollToColumn", "scrollTop", "scrollToRow" ]), _state = this.state, scrollLeft = _state.scrollLeft, scrollTop = _state.scrollTop;
+ return _react2.default.createElement("div", {
+ style: this._containerOuterStyle
+ }, _react2.default.createElement("div", {
+ style: this._containerTopStyle
+ }, this._renderTopLeftGrid(rest), this._renderTopRightGrid((0, _extends3.default)({}, rest, {
+ scrollLeft: scrollLeft
+ }))), _react2.default.createElement("div", {
+ style: this._containerBottomStyle
+ }, this._renderBottomLeftGrid((0, _extends3.default)({}, rest, {
+ scrollTop: scrollTop
+ })), this._renderBottomRightGrid((0, _extends3.default)({}, rest, {
+ onScroll: onScroll,
+ onSectionRendered: onSectionRendered,
+ scrollLeft: scrollLeft,
+ scrollToColumn: scrollToColumn,
+ scrollToRow: scrollToRow,
+ scrollTop: scrollTop
+ }))));
+ }
+ }, {
+ key: "_bottomLeftGridRef",
+ value: function(ref) {
+ this._bottomLeftGrid = ref;
+ }
+ }, {
+ key: "_bottomRightGridRef",
+ value: function(ref) {
+ this._bottomRightGrid = ref;
+ }
+ }, {
+ key: "_cellRendererBottomLeftGrid",
+ value: function(_ref2) {
+ var rowIndex = _ref2.rowIndex, rest = (0, _objectWithoutProperties3.default)(_ref2, [ "rowIndex" ]), _props4 = this.props, cellRenderer = _props4.cellRenderer, fixedRowCount = _props4.fixedRowCount;
+ return cellRenderer((0, _extends3.default)({}, rest, {
+ rowIndex: rowIndex + fixedRowCount
+ }));
+ }
+ }, {
+ key: "_cellRendererBottomRightGrid",
+ value: function(_ref3) {
+ var columnIndex = _ref3.columnIndex, rowIndex = _ref3.rowIndex, rest = (0, _objectWithoutProperties3.default)(_ref3, [ "columnIndex", "rowIndex" ]), _props5 = this.props, cellRenderer = _props5.cellRenderer, fixedColumnCount = _props5.fixedColumnCount, fixedRowCount = _props5.fixedRowCount;
+ return cellRenderer((0, _extends3.default)({}, rest, {
+ columnIndex: columnIndex + fixedColumnCount,
+ rowIndex: rowIndex + fixedRowCount
+ }));
+ }
+ }, {
+ key: "_cellRendererTopRightGrid",
+ value: function(_ref4) {
+ var columnIndex = _ref4.columnIndex, rest = (0, _objectWithoutProperties3.default)(_ref4, [ "columnIndex" ]), _props6 = this.props, cellRenderer = _props6.cellRenderer, fixedColumnCount = _props6.fixedColumnCount;
+ return cellRenderer((0, _extends3.default)({}, rest, {
+ columnIndex: columnIndex + fixedColumnCount
+ }));
+ }
+ }, {
+ key: "_columnWidthRightGrid",
+ value: function(_ref5) {
+ var index = _ref5.index, _props7 = this.props, fixedColumnCount = _props7.fixedColumnCount, columnWidth = _props7.columnWidth;
+ return "function" == typeof columnWidth ? columnWidth({
+ index: index + fixedColumnCount
+ }) : columnWidth;
+ }
+ }, {
+ key: "_getBottomGridHeight",
+ value: function(props) {
+ var height = props.height, topGridHeight = this._getTopGridHeight(props);
+ return height - topGridHeight;
+ }
+ }, {
+ key: "_getLeftGridWidth",
+ value: function(props) {
+ var fixedColumnCount = props.fixedColumnCount, columnWidth = props.columnWidth;
+ if (null == this._leftGridWidth) if ("function" == typeof columnWidth) {
+ for (var leftGridWidth = 0, index = 0; index < fixedColumnCount; index++) leftGridWidth += columnWidth({
+ index: index
+ });
+ this._leftGridWidth = leftGridWidth;
+ } else this._leftGridWidth = columnWidth * fixedColumnCount;
+ return this._leftGridWidth;
+ }
+ }, {
+ key: "_getRightGridWidth",
+ value: function(props) {
+ var width = props.width, leftGridWidth = this._getLeftGridWidth(props);
+ return width - leftGridWidth;
+ }
+ }, {
+ key: "_getTopGridHeight",
+ value: function(props) {
+ var fixedRowCount = props.fixedRowCount, rowHeight = props.rowHeight;
+ if (null == this._topGridHeight) if ("function" == typeof rowHeight) {
+ for (var topGridHeight = 0, index = 0; index < fixedRowCount; index++) topGridHeight += rowHeight({
+ index: index
+ });
+ this._topGridHeight = topGridHeight;
+ } else this._topGridHeight = rowHeight * fixedRowCount;
+ return this._topGridHeight;
+ }
+ }, {
+ key: "_maybeCalculateCachedStyles",
+ value: function(prevProps, props) {
+ var columnWidth = props.columnWidth, height = props.height, fixedColumnCount = props.fixedColumnCount, fixedRowCount = props.fixedRowCount, rowHeight = props.rowHeight, style = props.style, styleBottomLeftGrid = props.styleBottomLeftGrid, styleBottomRightGrid = props.styleBottomRightGrid, styleTopLeftGrid = props.styleTopLeftGrid, styleTopRightGrid = props.styleTopRightGrid, width = props.width, firstRender = !prevProps, sizeChange = firstRender || height !== prevProps.height || width !== prevProps.width, leftSizeChange = firstRender || columnWidth !== prevProps.columnWidth || fixedColumnCount !== prevProps.fixedColumnCount, topSizeChange = firstRender || fixedRowCount !== prevProps.fixedRowCount || rowHeight !== prevProps.rowHeight;
+ (firstRender || sizeChange || style !== prevProps.style) && (this._containerOuterStyle = (0,
+ _extends3.default)({
+ height: height,
+ width: width
+ }, style)), (firstRender || sizeChange || topSizeChange) && (this._containerTopStyle = {
+ height: this._getTopGridHeight(props),
+ position: "relative",
+ width: width
+ }, this._containerBottomStyle = {
+ height: height - this._getTopGridHeight(props),
+ overflow: "hidden",
+ position: "relative",
+ width: width
+ }), (firstRender || styleBottomLeftGrid !== prevProps.styleBottomLeftGrid) && (this._bottomLeftGridStyle = (0,
+ _extends3.default)({
+ left: 0,
+ outline: 0,
+ overflowX: "hidden",
+ overflowY: "hidden",
+ position: "absolute"
+ }, styleBottomLeftGrid)), (firstRender || leftSizeChange || styleBottomRightGrid !== prevProps.styleBottomRightGrid) && (this._bottomRightGridStyle = (0,
+ _extends3.default)({
+ left: this._getLeftGridWidth(props),
+ outline: 0,
+ position: "absolute"
+ }, styleBottomRightGrid)), (firstRender || styleTopLeftGrid !== prevProps.styleTopLeftGrid) && (this._topLeftGridStyle = (0,
+ _extends3.default)({
+ left: 0,
+ outline: 0,
+ overflowX: "hidden",
+ overflowY: "hidden",
+ position: "absolute",
+ top: 0
+ }, styleTopLeftGrid)), (firstRender || leftSizeChange || styleTopRightGrid !== prevProps.styleTopRightGrid) && (this._topRightGridStyle = (0,
+ _extends3.default)({
+ left: this._getLeftGridWidth(props),
+ outline: 0,
+ overflowX: "hidden",
+ overflowY: "hidden",
+ position: "absolute",
+ top: 0
+ }, styleTopRightGrid));
+ }
+ }, {
+ key: "_onScroll",
+ value: function(scrollInfo) {
+ var scrollLeft = scrollInfo.scrollLeft, scrollTop = scrollInfo.scrollTop;
+ this.setState({
+ scrollLeft: scrollLeft,
+ scrollTop: scrollTop
+ });
+ var onScroll = this.props.onScroll;
+ onScroll && onScroll(scrollInfo);
+ }
+ }, {
+ key: "_renderBottomLeftGrid",
+ value: function(props) {
+ var fixedColumnCount = props.fixedColumnCount, fixedRowCount = props.fixedRowCount, rowCount = props.rowCount, scrollTop = props.scrollTop;
+ return fixedColumnCount ? _react2.default.createElement(_Grid2.default, (0, _extends3.default)({}, props, {
+ cellRenderer: this._cellRendererBottomLeftGrid,
+ columnCount: fixedColumnCount,
+ height: this._getBottomGridHeight(props),
+ ref: this._bottomLeftGridRef,
+ rowCount: Math.max(0, rowCount - fixedRowCount),
+ rowHeight: this._rowHeightBottomGrid,
+ scrollTop: scrollTop,
+ style: this._bottomLeftGridStyle,
+ width: this._getLeftGridWidth(props)
+ })) : null;
+ }
+ }, {
+ key: "_renderBottomRightGrid",
+ value: function(props) {
+ var columnCount = props.columnCount, fixedColumnCount = props.fixedColumnCount, fixedRowCount = props.fixedRowCount, rowCount = props.rowCount, scrollToColumn = props.scrollToColumn, scrollToRow = props.scrollToRow;
+ return _react2.default.createElement(_Grid2.default, (0, _extends3.default)({}, props, {
+ cellRenderer: this._cellRendererBottomRightGrid,
+ columnCount: Math.max(0, columnCount - fixedColumnCount),
+ columnWidth: this._columnWidthRightGrid,
+ height: this._getBottomGridHeight(props),
+ onScroll: this._onScroll,
+ ref: this._bottomRightGridRef,
+ rowCount: Math.max(0, rowCount - fixedRowCount),
+ rowHeight: this._rowHeightBottomGrid,
+ scrollToColumn: scrollToColumn - fixedColumnCount,
+ scrollToRow: scrollToRow - fixedRowCount,
+ style: this._bottomRightGridStyle,
+ width: this._getRightGridWidth(props)
+ }));
+ }
+ }, {
+ key: "_renderTopLeftGrid",
+ value: function(props) {
+ var fixedColumnCount = props.fixedColumnCount, fixedRowCount = props.fixedRowCount;
+ return fixedColumnCount && fixedRowCount ? _react2.default.createElement(_Grid2.default, (0,
+ _extends3.default)({}, props, {
+ columnCount: fixedColumnCount,
+ height: this._getTopGridHeight(props),
+ ref: this._topLeftGridRef,
+ rowCount: fixedRowCount,
+ style: this._topLeftGridStyle,
+ width: this._getLeftGridWidth(props)
+ })) : null;
+ }
+ }, {
+ key: "_renderTopRightGrid",
+ value: function(props) {
+ var columnCount = props.columnCount, fixedColumnCount = props.fixedColumnCount, fixedRowCount = props.fixedRowCount, scrollLeft = props.scrollLeft;
+ return fixedRowCount ? _react2.default.createElement(_Grid2.default, (0, _extends3.default)({}, props, {
+ cellRenderer: this._cellRendererTopRightGrid,
+ columnCount: Math.max(0, columnCount - fixedColumnCount),
+ columnWidth: this._columnWidthRightGrid,
+ height: this._getTopGridHeight(props),
+ ref: this._topRightGridRef,
+ rowCount: fixedRowCount,
+ scrollLeft: scrollLeft,
+ style: this._topRightGridStyle,
+ width: this._getRightGridWidth(props)
+ })) : null;
+ }
+ }, {
+ key: "_rowHeightBottomGrid",
+ value: function(_ref6) {
+ var index = _ref6.index, _props8 = this.props, fixedRowCount = _props8.fixedRowCount, rowHeight = _props8.rowHeight;
+ return "function" == typeof rowHeight ? rowHeight({
+ index: index + fixedRowCount
+ }) : rowHeight;
+ }
+ }, {
+ key: "_topLeftGridRef",
+ value: function(ref) {
+ this._topLeftGrid = ref;
+ }
+ }, {
+ key: "_topRightGridRef",
+ value: function(ref) {
+ this._topRightGrid = ref;
+ }
+ } ]), MultiGrid;
+ }(_react.PureComponent);
+ MultiGrid.defaultProps = {
+ fixedColumnCount: 0,
+ fixedRowCount: 0,
+ style: {},
+ styleBottomLeftGrid: {},
+ styleBottomRightGrid: {},
+ styleTopLeftGrid: {},
+ styleTopRightGrid: {}
+ }, exports.default = MultiGrid;
+ }, /* 146 */
+ /***/
+ function(module, exports, __webpack_require__) {
+ "use strict";
+ function _interopRequireDefault(obj) {
+ return obj && obj.__esModule ? obj : {
+ default: obj
+ };
+ }
+ Object.defineProperty(exports, "__esModule", {
+ value: !0
+ }), exports.ScrollSync = exports.default = void 0;
+ var _ScrollSync2 = __webpack_require__(147), _ScrollSync3 = _interopRequireDefault(_ScrollSync2);
+ exports.default = _ScrollSync3.default, exports.ScrollSync = _ScrollSync3.default;
+ }, /* 147 */
+ /***/
+ function(module, exports, __webpack_require__) {
+ "use strict";
+ function _interopRequireDefault(obj) {
+ return obj && obj.__esModule ? obj : {
+ default: obj
+ };
+ }
+ Object.defineProperty(exports, "__esModule", {
+ value: !0
+ });
+ var _getPrototypeOf = __webpack_require__(3), _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf), _classCallCheck2 = __webpack_require__(29), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _createClass2 = __webpack_require__(30), _createClass3 = _interopRequireDefault(_createClass2), _possibleConstructorReturn2 = __webpack_require__(34), _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2), _inherits2 = __webpack_require__(81), _inherits3 = _interopRequireDefault(_inherits2), _react = __webpack_require__(89), ScrollSync = function(_PureComponent) {
+ function ScrollSync(props, context) {
+ (0, _classCallCheck3.default)(this, ScrollSync);
+ var _this = (0, _possibleConstructorReturn3.default)(this, (ScrollSync.__proto__ || (0,
+ _getPrototypeOf2.default)(ScrollSync)).call(this, props, context));
+ return _this.state = {
+ clientHeight: 0,
+ clientWidth: 0,
+ scrollHeight: 0,
+ scrollLeft: 0,
+ scrollTop: 0,
+ scrollWidth: 0
+ }, _this._onScroll = _this._onScroll.bind(_this), _this;
+ }
+ return (0, _inherits3.default)(ScrollSync, _PureComponent), (0, _createClass3.default)(ScrollSync, [ {
+ key: "render",
+ value: function() {
+ var children = this.props.children, _state = this.state, clientHeight = _state.clientHeight, clientWidth = _state.clientWidth, scrollHeight = _state.scrollHeight, scrollLeft = _state.scrollLeft, scrollTop = _state.scrollTop, scrollWidth = _state.scrollWidth;
+ return children({
+ clientHeight: clientHeight,
+ clientWidth: clientWidth,
+ onScroll: this._onScroll,
+ scrollHeight: scrollHeight,
+ scrollLeft: scrollLeft,
+ scrollTop: scrollTop,
+ scrollWidth: scrollWidth
+ });
+ }
+ }, {
+ key: "_onScroll",
+ value: function(_ref) {
+ var clientHeight = _ref.clientHeight, clientWidth = _ref.clientWidth, scrollHeight = _ref.scrollHeight, scrollLeft = _ref.scrollLeft, scrollTop = _ref.scrollTop, scrollWidth = _ref.scrollWidth;
+ this.setState({
+ clientHeight: clientHeight,
+ clientWidth: clientWidth,
+ scrollHeight: scrollHeight,
+ scrollLeft: scrollLeft,
+ scrollTop: scrollTop,
+ scrollWidth: scrollWidth
+ });
+ }
+ } ]), ScrollSync;
+ }(_react.PureComponent);
+ exports.default = ScrollSync;
+ }, /* 148 */
+ /***/
+ function(module, exports, __webpack_require__) {
+ "use strict";
+ function _interopRequireDefault(obj) {
+ return obj && obj.__esModule ? obj : {
+ default: obj
+ };
+ }
+ Object.defineProperty(exports, "__esModule", {
+ value: !0
+ }), exports.IS_SCROLLING_TIMEOUT = exports.WindowScroller = exports.default = void 0;
+ var _onScroll = __webpack_require__(149);
+ Object.defineProperty(exports, "IS_SCROLLING_TIMEOUT", {
+ enumerable: !0,
+ get: function() {
+ return _onScroll.IS_SCROLLING_TIMEOUT;
+ }
+ });
+ var _WindowScroller2 = __webpack_require__(150), _WindowScroller3 = _interopRequireDefault(_WindowScroller2);
+ exports.default = _WindowScroller3.default, exports.WindowScroller = _WindowScroller3.default;
+ }, /* 149 */
+ /***/
+ function(module, exports) {
+ "use strict";
+ function enablePointerEventsIfDisabled() {
+ disablePointerEventsTimeoutId && (disablePointerEventsTimeoutId = null, document.body.style.pointerEvents = originalBodyPointerEvents,
+ originalBodyPointerEvents = null);
+ }
+ function enablePointerEventsAfterDelayCallback() {
+ enablePointerEventsIfDisabled(), mountedInstances.forEach(function(instance) {
+ return instance.__resetIsScrolling();
+ });
+ }
+ function enablePointerEventsAfterDelay() {
+ disablePointerEventsTimeoutId && clearTimeout(disablePointerEventsTimeoutId), disablePointerEventsTimeoutId = setTimeout(enablePointerEventsAfterDelayCallback, IS_SCROLLING_TIMEOUT);
+ }
+ function onScrollWindow(event) {
+ event.currentTarget === window && null == originalBodyPointerEvents && (originalBodyPointerEvents = document.body.style.pointerEvents,
+ document.body.style.pointerEvents = "none"), enablePointerEventsAfterDelay(), mountedInstances.forEach(function(instance) {
+ instance.scrollElement === event.currentTarget && instance.__handleWindowScrollEvent(event);
+ });
+ }
+ function registerScrollListener(component, element) {
+ mountedInstances.some(function(instance) {
+ return instance.scrollElement === element;
+ }) || element.addEventListener("scroll", onScrollWindow), mountedInstances.push(component);
+ }
+ function unregisterScrollListener(component, element) {
+ mountedInstances = mountedInstances.filter(function(instance) {
+ return instance !== component;
+ }), mountedInstances.length || (element.removeEventListener("scroll", onScrollWindow),
+ disablePointerEventsTimeoutId && (clearTimeout(disablePointerEventsTimeoutId), enablePointerEventsIfDisabled()));
+ }
+ Object.defineProperty(exports, "__esModule", {
+ value: !0
+ }), exports.registerScrollListener = registerScrollListener, exports.unregisterScrollListener = unregisterScrollListener;
+ var mountedInstances = [], originalBodyPointerEvents = null, disablePointerEventsTimeoutId = null, IS_SCROLLING_TIMEOUT = exports.IS_SCROLLING_TIMEOUT = 150;
+ }, /* 150 */
+ /***/
+ function(module, exports, __webpack_require__) {
+ "use strict";
+ function _interopRequireDefault(obj) {
+ return obj && obj.__esModule ? obj : {
+ default: obj
+ };
+ }
+ Object.defineProperty(exports, "__esModule", {
+ value: !0
+ });
+ var _getPrototypeOf = __webpack_require__(3), _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf), _classCallCheck2 = __webpack_require__(29), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _createClass2 = __webpack_require__(30), _createClass3 = _interopRequireDefault(_createClass2), _possibleConstructorReturn2 = __webpack_require__(34), _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2), _inherits2 = __webpack_require__(81), _inherits3 = _interopRequireDefault(_inherits2), _react = __webpack_require__(89), _reactDom = __webpack_require__(96), _reactDom2 = _interopRequireDefault(_reactDom), _onScroll = __webpack_require__(149), _dimensions = __webpack_require__(151), WindowScroller = function(_PureComponent) {
function WindowScroller(props) {
(0, _classCallCheck3.default)(this, WindowScroller);
var _this = (0, _possibleConstructorReturn3.default)(this, (WindowScroller.__proto__ || (0,
- _getPrototypeOf2.default)(WindowScroller)).call(this, props)), height = "undefined" != typeof window ? window.innerHeight : 0;
+ _getPrototypeOf2.default)(WindowScroller)).call(this, props)), height = "undefined" != typeof window ? (0,
+ _dimensions.getHeight)(props.scrollElement || window) : 0;
return _this.state = {
+ height: height,
isScrolling: !1,
- height: height,
scrollTop: 0
- }, _this._onScrollWindow = _this._onScrollWindow.bind(_this), _this._onResizeWindow = _this._onResizeWindow.bind(_this),
- _this._enablePointerEventsAfterDelayCallback = _this._enablePointerEventsAfterDelayCallback.bind(_this),
- _this;
+ }, _this._onResize = _this._onResize.bind(_this), _this.__handleWindowScrollEvent = _this.__handleWindowScrollEvent.bind(_this),
+ _this.__resetIsScrolling = _this.__resetIsScrolling.bind(_this), _this;
}
- return (0, _inherits3.default)(WindowScroller, _Component), (0, _createClass3.default)(WindowScroller, [ {
+ return (0, _inherits3.default)(WindowScroller, _PureComponent), (0, _createClass3.default)(WindowScroller, [ {
+ key: "updatePosition",
+ value: function(scrollElement) {
+ var onResize = this.props.onResize, height = this.state.height;
+ scrollElement = scrollElement || this.props.scrollElement || window, this._positionFromTop = (0,
+ _dimensions.getPositionFromTop)(_reactDom2.default.findDOMNode(this), scrollElement);
+ var newHeight = (0, _dimensions.getHeight)(scrollElement);
+ height !== newHeight && (this.setState({
+ height: newHeight
+ }), onResize({
+ height: newHeight
+ }));
+ }
+ }, {
key: "componentDidMount",
value: function() {
- var height = this.state.height;
- this._positionFromTop = _reactDom2.default.findDOMNode(this).getBoundingClientRect().top - document.documentElement.getBoundingClientRect().top,
- height !== window.innerHeight && this.setState({
- height: window.innerHeight
- }), (0, _onScroll.registerScrollListener)(this), window.addEventListener("resize", this._onResizeWindow, !1);
+ var scrollElement = this.props.scrollElement || window;
+ this.updatePosition(scrollElement), (0, _onScroll.registerScrollListener)(this, scrollElement),
+ window.addEventListener("resize", this._onResize, !1);
+ }
+ }, {
+ key: "componentWillReceiveProps",
+ value: function(nextProps) {
+ var scrollElement = this.props.scrollElement || window, nextScrollElement = nextProps.scrollElement || window;
+ scrollElement !== nextScrollElement && (this.updatePosition(nextScrollElement),
+ (0, _onScroll.unregisterScrollListener)(this, scrollElement), (0, _onScroll.registerScrollListener)(this, nextScrollElement));
}
}, {
key: "componentWillUnmount",
value: function() {
- (0, _onScroll.unregisterScrollListener)(this), window.removeEventListener("resize", this._onResizeWindow, !1);
+ (0, _onScroll.unregisterScrollListener)(this, this.props.scrollElement || window),
+ window.removeEventListener("resize", this._onResize, !1);
}
}, {
key: "render",
value: function() {
var children = this.props.children, _state = this.state, isScrolling = _state.isScrolling, scrollTop = _state.scrollTop, height = _state.height;
- return _react2.default.createElement("div", null, children({
+ return children({
height: height,
isScrolling: isScrolling,
scrollTop: scrollTop
- }));
- }
- }, {
- key: "shouldComponentUpdate",
- value: function(nextProps, nextState) {
- return (0, _reactAddonsShallowCompare2.default)(this, nextProps, nextState);
- }
- }, {
- key: "_enablePointerEventsAfterDelayCallback",
- value: function() {
- this.setState({
- isScrolling: !1
});
}
}, {
- key: "_onResizeWindow",
+ key: "_onResize",
value: function(event) {
- var onResize = this.props.onResize, height = window.innerHeight || 0;
- this.setState({
- height: height
- }), onResize({
- height: height
- });
+ this.updatePosition();
}
}, {
- key: "_onScrollWindow",
+ key: "__handleWindowScrollEvent",
value: function(event) {
- var onScroll = this.props.onScroll, scrollY = "scrollY" in window ? window.scrollY : document.documentElement.scrollTop, scrollTop = Math.max(0, scrollY - this._positionFromTop);
+ var onScroll = this.props.onScroll, scrollElement = this.props.scrollElement || window, scrollTop = Math.max(0, (0,
+ _dimensions.getScrollTop)(scrollElement) - this._positionFromTop);
this.setState({
isScrolling: !0,
scrollTop: scrollTop
}), onScroll({
scrollTop: scrollTop
});
}
+ }, {
+ key: "__resetIsScrolling",
+ value: function() {
+ this.setState({
+ isScrolling: !1
+ });
+ }
+ }, {
+ key: "scrollElement",
+ get: function() {
+ return this.props.scrollElement || window;
+ }
} ]), WindowScroller;
- }(_react.Component);
+ }(_react.PureComponent);
WindowScroller.defaultProps = {
onResize: function() {},
onScroll: function() {}
}, exports.default = WindowScroller;
+ }, /* 151 */
+ /***/
+ function(module, exports) {
+ "use strict";
+ function getHeight(element) {
+ return element === window ? "number" == typeof window.innerHeight ? window.innerHeight : 0 : element.getBoundingClientRect().height;
+ }
+ function getPositionFromTop(element, container) {
+ var offset = container === window ? 0 : getScrollTop(container), containerElement = container === window ? document.documentElement : container;
+ return element.getBoundingClientRect().top + offset - containerElement.getBoundingClientRect().top;
+ }
+ function getScrollTop(element) {
+ return element === window ? "scrollY" in window ? window.scrollY : document.documentElement.scrollTop : element.scrollTop;
+ }
+ Object.defineProperty(exports, "__esModule", {
+ value: !0
+ }), exports.getHeight = getHeight, exports.getPositionFromTop = getPositionFromTop,
+ exports.getScrollTop = getScrollTop;
} ]);
});
-//# sourceMappingURL=react-virtualized.js.map
\ No newline at end of file
+//# sourceMappingURL=react-virtualized.js.map