@depup/react-virtualized 9.22.6-depup.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +34 -0
- package/changes.json +22 -0
- package/dist/commonjs/ArrowKeyStepper/ArrowKeyStepper.example.js +184 -0
- package/dist/commonjs/ArrowKeyStepper/ArrowKeyStepper.jest.js +338 -0
- package/dist/commonjs/ArrowKeyStepper/ArrowKeyStepper.js +204 -0
- package/dist/commonjs/ArrowKeyStepper/index.js +19 -0
- package/dist/commonjs/ArrowKeyStepper/types.js +5 -0
- package/dist/commonjs/AutoSizer/AutoSizer.example.js +104 -0
- package/dist/commonjs/AutoSizer/AutoSizer.jest.js +341 -0
- package/dist/commonjs/AutoSizer/AutoSizer.js +199 -0
- package/dist/commonjs/AutoSizer/AutoSizer.ssr.js +25 -0
- package/dist/commonjs/AutoSizer/index.js +19 -0
- package/dist/commonjs/CellMeasurer/CellMeasurer.DynamicHeightGrid.example.js +100 -0
- package/dist/commonjs/CellMeasurer/CellMeasurer.DynamicHeightList.example.js +99 -0
- package/dist/commonjs/CellMeasurer/CellMeasurer.DynamicHeightTableColumn.example.js +107 -0
- package/dist/commonjs/CellMeasurer/CellMeasurer.DynamicWidthGrid.example.js +102 -0
- package/dist/commonjs/CellMeasurer/CellMeasurer.DynamicWidthMultiGrid.example.js +107 -0
- package/dist/commonjs/CellMeasurer/CellMeasurer.example.js +129 -0
- package/dist/commonjs/CellMeasurer/CellMeasurer.jest.js +345 -0
- package/dist/commonjs/CellMeasurer/CellMeasurer.js +195 -0
- package/dist/commonjs/CellMeasurer/CellMeasurerCache.jest.js +298 -0
- package/dist/commonjs/CellMeasurer/CellMeasurerCache.js +202 -0
- package/dist/commonjs/CellMeasurer/index.js +22 -0
- package/dist/commonjs/CellMeasurer/types.js +14 -0
- package/dist/commonjs/Collection/Collection.example.js +231 -0
- package/dist/commonjs/Collection/Collection.jest.js +829 -0
- package/dist/commonjs/Collection/Collection.js +266 -0
- package/dist/commonjs/Collection/CollectionView.js +553 -0
- package/dist/commonjs/Collection/Section.jest.js +63 -0
- package/dist/commonjs/Collection/Section.js +57 -0
- package/dist/commonjs/Collection/SectionManager.jest.js +121 -0
- package/dist/commonjs/Collection/SectionManager.js +134 -0
- package/dist/commonjs/Collection/TestData.js +77 -0
- package/dist/commonjs/Collection/index.js +15 -0
- package/dist/commonjs/Collection/types.js +22 -0
- package/dist/commonjs/Collection/utils/calculateSizeAndPositionData.jest.js +34 -0
- package/dist/commonjs/Collection/utils/calculateSizeAndPositionData.js +38 -0
- package/dist/commonjs/ColumnSizer/ColumnSizer.example.js +159 -0
- package/dist/commonjs/ColumnSizer/ColumnSizer.jest.js +129 -0
- package/dist/commonjs/ColumnSizer/ColumnSizer.js +103 -0
- package/dist/commonjs/ColumnSizer/index.js +15 -0
- package/dist/commonjs/Grid/Grid.example.js +330 -0
- package/dist/commonjs/Grid/Grid.jest.js +2561 -0
- package/dist/commonjs/Grid/Grid.js +1432 -0
- package/dist/commonjs/Grid/Grid.ssr.js +62 -0
- package/dist/commonjs/Grid/accessibilityOverscanIndicesGetter.jest.js +92 -0
- package/dist/commonjs/Grid/accessibilityOverscanIndicesGetter.js +40 -0
- package/dist/commonjs/Grid/defaultCellRangeRenderer.js +139 -0
- package/dist/commonjs/Grid/defaultOverscanIndicesGetter.jest.js +92 -0
- package/dist/commonjs/Grid/defaultOverscanIndicesGetter.js +36 -0
- package/dist/commonjs/Grid/index.js +40 -0
- package/dist/commonjs/Grid/types.js +8 -0
- package/dist/commonjs/Grid/utils/CellSizeAndPositionManager.jest.js +375 -0
- package/dist/commonjs/Grid/utils/CellSizeAndPositionManager.js +296 -0
- package/dist/commonjs/Grid/utils/ScalingCellSizeAndPositionManager.jest.js +201 -0
- package/dist/commonjs/Grid/utils/ScalingCellSizeAndPositionManager.js +204 -0
- package/dist/commonjs/Grid/utils/calculateSizeAndPositionDataAndUpdateScrollOffset.jest.js +84 -0
- package/dist/commonjs/Grid/utils/calculateSizeAndPositionDataAndUpdateScrollOffset.js +59 -0
- package/dist/commonjs/Grid/utils/maxElementSize.js +22 -0
- package/dist/commonjs/Grid/utils/updateScrollIndexHelper.jest.js +180 -0
- package/dist/commonjs/Grid/utils/updateScrollIndexHelper.js +85 -0
- package/dist/commonjs/InfiniteLoader/InfiniteLoader.example.js +179 -0
- package/dist/commonjs/InfiniteLoader/InfiniteLoader.jest.js +571 -0
- package/dist/commonjs/InfiniteLoader/InfiniteLoader.js +274 -0
- package/dist/commonjs/InfiniteLoader/index.js +15 -0
- package/dist/commonjs/List/List.example.js +236 -0
- package/dist/commonjs/List/List.jest.js +517 -0
- package/dist/commonjs/List/List.js +318 -0
- package/dist/commonjs/List/index.js +19 -0
- package/dist/commonjs/List/types.js +6 -0
- package/dist/commonjs/Masonry/Masonry.example.js +287 -0
- package/dist/commonjs/Masonry/Masonry.jest.js +450 -0
- package/dist/commonjs/Masonry/Masonry.js +431 -0
- package/dist/commonjs/Masonry/PositionCache.js +88 -0
- package/dist/commonjs/Masonry/createCellPositioner.js +59 -0
- package/dist/commonjs/Masonry/index.js +22 -0
- package/dist/commonjs/MultiGrid/CellMeasurerCacheDecorator.js +106 -0
- package/dist/commonjs/MultiGrid/MultiGrid.example.js +131 -0
- package/dist/commonjs/MultiGrid/MultiGrid.jest.js +584 -0
- package/dist/commonjs/MultiGrid/MultiGrid.js +743 -0
- package/dist/commonjs/MultiGrid/index.js +15 -0
- package/dist/commonjs/ScrollSync/ScrollSync.example.js +257 -0
- package/dist/commonjs/ScrollSync/ScrollSync.jest.js +66 -0
- package/dist/commonjs/ScrollSync/ScrollSync.js +88 -0
- package/dist/commonjs/ScrollSync/index.js +15 -0
- package/dist/commonjs/Table/Column.jest.js +90 -0
- package/dist/commonjs/Table/Column.js +93 -0
- package/dist/commonjs/Table/SortDirection.js +19 -0
- package/dist/commonjs/Table/SortIndicator.js +40 -0
- package/dist/commonjs/Table/Table.example.js +325 -0
- package/dist/commonjs/Table/Table.jest.js +1257 -0
- package/dist/commonjs/Table/Table.js +742 -0
- package/dist/commonjs/Table/createMultiSort.jest.js +165 -0
- package/dist/commonjs/Table/createMultiSort.js +99 -0
- package/dist/commonjs/Table/defaultCellDataGetter.js +21 -0
- package/dist/commonjs/Table/defaultCellRenderer.js +19 -0
- package/dist/commonjs/Table/defaultHeaderRenderer.js +35 -0
- package/dist/commonjs/Table/defaultHeaderRowRenderer.js +21 -0
- package/dist/commonjs/Table/defaultRowRenderer.js +87 -0
- package/dist/commonjs/Table/index.js +78 -0
- package/dist/commonjs/Table/types.js +39 -0
- package/dist/commonjs/WindowScroller/WindowScroller.e2e.js +298 -0
- package/dist/commonjs/WindowScroller/WindowScroller.example.js +167 -0
- package/dist/commonjs/WindowScroller/WindowScroller.header-resize.e2e.js +359 -0
- package/dist/commonjs/WindowScroller/WindowScroller.jest.js +536 -0
- package/dist/commonjs/WindowScroller/WindowScroller.js +268 -0
- package/dist/commonjs/WindowScroller/WindowScroller.ssr.js +25 -0
- package/dist/commonjs/WindowScroller/index.js +23 -0
- package/dist/commonjs/WindowScroller/utils/dimensions.js +89 -0
- package/dist/commonjs/WindowScroller/utils/onScroll.js +70 -0
- package/dist/commonjs/index.js +180 -0
- package/dist/commonjs/jest-setup.js +7 -0
- package/dist/commonjs/utils/TestHelper.js +36 -0
- package/dist/commonjs/utils/animationFrame.js +29 -0
- package/dist/commonjs/utils/createCallbackMemoizer.jest.js +219 -0
- package/dist/commonjs/utils/createCallbackMemoizer.js +31 -0
- package/dist/commonjs/utils/getUpdatedOffsetForIndex.jest.js +68 -0
- package/dist/commonjs/utils/getUpdatedOffsetForIndex.js +38 -0
- package/dist/commonjs/utils/initCellMetadata.js +37 -0
- package/dist/commonjs/utils/requestAnimationTimeout.js +38 -0
- package/dist/commonjs/vendor/binarySearchBounds.js +200 -0
- package/dist/commonjs/vendor/detectElementResize.js +192 -0
- package/dist/commonjs/vendor/intervalTree.js +361 -0
- package/dist/es/ArrowKeyStepper/ArrowKeyStepper.example.js +176 -0
- package/dist/es/ArrowKeyStepper/ArrowKeyStepper.jest.js +332 -0
- package/dist/es/ArrowKeyStepper/ArrowKeyStepper.js +197 -0
- package/dist/es/ArrowKeyStepper/index.js +3 -0
- package/dist/es/ArrowKeyStepper/types.js +4 -0
- package/dist/es/AutoSizer/AutoSizer.example.js +96 -0
- package/dist/es/AutoSizer/AutoSizer.jest.js +335 -0
- package/dist/es/AutoSizer/AutoSizer.js +190 -0
- package/dist/es/AutoSizer/AutoSizer.js.flow +200 -0
- package/dist/es/AutoSizer/AutoSizer.ssr.js +19 -0
- package/dist/es/AutoSizer/index.js +2 -0
- package/dist/es/AutoSizer/index.js.flow +4 -0
- package/dist/es/CellMeasurer/CellMeasurer.DynamicHeightGrid.example.js +91 -0
- package/dist/es/CellMeasurer/CellMeasurer.DynamicHeightList.example.js +90 -0
- package/dist/es/CellMeasurer/CellMeasurer.DynamicHeightTableColumn.example.js +98 -0
- package/dist/es/CellMeasurer/CellMeasurer.DynamicWidthGrid.example.js +93 -0
- package/dist/es/CellMeasurer/CellMeasurer.DynamicWidthMultiGrid.example.js +98 -0
- package/dist/es/CellMeasurer/CellMeasurer.example.js +120 -0
- package/dist/es/CellMeasurer/CellMeasurer.jest.js +340 -0
- package/dist/es/CellMeasurer/CellMeasurer.js +187 -0
- package/dist/es/CellMeasurer/CellMeasurerCache.jest.js +293 -0
- package/dist/es/CellMeasurer/CellMeasurerCache.js +196 -0
- package/dist/es/CellMeasurer/index.js +4 -0
- package/dist/es/CellMeasurer/types.js +13 -0
- package/dist/es/Collection/Collection.example.js +223 -0
- package/dist/es/Collection/Collection.jest.js +824 -0
- package/dist/es/Collection/Collection.js +257 -0
- package/dist/es/Collection/CollectionView.js +544 -0
- package/dist/es/Collection/Section.jest.js +60 -0
- package/dist/es/Collection/Section.js +51 -0
- package/dist/es/Collection/SectionManager.jest.js +118 -0
- package/dist/es/Collection/SectionManager.js +128 -0
- package/dist/es/Collection/TestData.js +71 -0
- package/dist/es/Collection/index.js +3 -0
- package/dist/es/Collection/types.js +21 -0
- package/dist/es/Collection/utils/calculateSizeAndPositionData.jest.js +31 -0
- package/dist/es/Collection/utils/calculateSizeAndPositionData.js +31 -0
- package/dist/es/ColumnSizer/ColumnSizer.example.js +150 -0
- package/dist/es/ColumnSizer/ColumnSizer.jest.js +123 -0
- package/dist/es/ColumnSizer/ColumnSizer.js +95 -0
- package/dist/es/ColumnSizer/index.js +3 -0
- package/dist/es/Grid/Grid.example.js +321 -0
- package/dist/es/Grid/Grid.jest.js +2555 -0
- package/dist/es/Grid/Grid.js +1425 -0
- package/dist/es/Grid/Grid.ssr.js +57 -0
- package/dist/es/Grid/accessibilityOverscanIndicesGetter.jest.js +87 -0
- package/dist/es/Grid/accessibilityOverscanIndicesGetter.js +33 -0
- package/dist/es/Grid/defaultCellRangeRenderer.js +134 -0
- package/dist/es/Grid/defaultOverscanIndicesGetter.jest.js +87 -0
- package/dist/es/Grid/defaultOverscanIndicesGetter.js +29 -0
- package/dist/es/Grid/index.js +15 -0
- package/dist/es/Grid/types.js +96 -0
- package/dist/es/Grid/utils/CellSizeAndPositionManager.jest.js +372 -0
- package/dist/es/Grid/utils/CellSizeAndPositionManager.js +290 -0
- package/dist/es/Grid/utils/ScalingCellSizeAndPositionManager.jest.js +198 -0
- package/dist/es/Grid/utils/ScalingCellSizeAndPositionManager.js +198 -0
- package/dist/es/Grid/utils/calculateSizeAndPositionDataAndUpdateScrollOffset.jest.js +81 -0
- package/dist/es/Grid/utils/calculateSizeAndPositionDataAndUpdateScrollOffset.js +53 -0
- package/dist/es/Grid/utils/maxElementSize.js +16 -0
- package/dist/es/Grid/utils/updateScrollIndexHelper.jest.js +174 -0
- package/dist/es/Grid/utils/updateScrollIndexHelper.js +79 -0
- package/dist/es/InfiniteLoader/InfiniteLoader.example.js +170 -0
- package/dist/es/InfiniteLoader/InfiniteLoader.jest.js +565 -0
- package/dist/es/InfiniteLoader/InfiniteLoader.js +263 -0
- package/dist/es/InfiniteLoader/index.js +3 -0
- package/dist/es/List/List.example.js +227 -0
- package/dist/es/List/List.jest.js +511 -0
- package/dist/es/List/List.js +312 -0
- package/dist/es/List/index.js +3 -0
- package/dist/es/List/types.js +21 -0
- package/dist/es/Masonry/Masonry.example.js +278 -0
- package/dist/es/Masonry/Masonry.jest.js +444 -0
- package/dist/es/Masonry/Masonry.js +421 -0
- package/dist/es/Masonry/PositionCache.js +82 -0
- package/dist/es/Masonry/createCellPositioner.js +53 -0
- package/dist/es/Masonry/index.js +4 -0
- package/dist/es/MultiGrid/CellMeasurerCacheDecorator.js +100 -0
- package/dist/es/MultiGrid/MultiGrid.example.js +122 -0
- package/dist/es/MultiGrid/MultiGrid.jest.js +579 -0
- package/dist/es/MultiGrid/MultiGrid.js +733 -0
- package/dist/es/MultiGrid/index.js +3 -0
- package/dist/es/ScrollSync/ScrollSync.example.js +248 -0
- package/dist/es/ScrollSync/ScrollSync.jest.js +60 -0
- package/dist/es/ScrollSync/ScrollSync.js +80 -0
- package/dist/es/ScrollSync/index.js +3 -0
- package/dist/es/Table/Column.jest.js +84 -0
- package/dist/es/Table/Column.js +85 -0
- package/dist/es/Table/SortDirection.js +13 -0
- package/dist/es/Table/SortIndicator.js +31 -0
- package/dist/es/Table/Table.example.js +316 -0
- package/dist/es/Table/Table.jest.js +1251 -0
- package/dist/es/Table/Table.js +735 -0
- package/dist/es/Table/createMultiSort.jest.js +162 -0
- package/dist/es/Table/createMultiSort.js +93 -0
- package/dist/es/Table/defaultCellDataGetter.js +15 -0
- package/dist/es/Table/defaultCellRenderer.js +13 -0
- package/dist/es/Table/defaultHeaderRenderer.js +25 -0
- package/dist/es/Table/defaultHeaderRowRenderer.js +12 -0
- package/dist/es/Table/defaultRowRenderer.js +77 -0
- package/dist/es/Table/index.js +12 -0
- package/dist/es/Table/types.js +38 -0
- package/dist/es/WindowScroller/WindowScroller.e2e.js +295 -0
- package/dist/es/WindowScroller/WindowScroller.example.js +158 -0
- package/dist/es/WindowScroller/WindowScroller.header-resize.e2e.js +356 -0
- package/dist/es/WindowScroller/WindowScroller.jest.js +530 -0
- package/dist/es/WindowScroller/WindowScroller.js +259 -0
- package/dist/es/WindowScroller/WindowScroller.js.flow +277 -0
- package/dist/es/WindowScroller/WindowScroller.ssr.js +19 -0
- package/dist/es/WindowScroller/index.js +3 -0
- package/dist/es/WindowScroller/index.js.flow +6 -0
- package/dist/es/WindowScroller/utils/dimensions.js +81 -0
- package/dist/es/WindowScroller/utils/dimensions.js.flow +91 -0
- package/dist/es/WindowScroller/utils/onScroll.js +64 -0
- package/dist/es/WindowScroller/utils/onScroll.js.flow +94 -0
- package/dist/es/index.js +13 -0
- package/dist/es/jest-setup.js +5 -0
- package/dist/es/utils/TestHelper.js +30 -0
- package/dist/es/utils/animationFrame.js +23 -0
- package/dist/es/utils/createCallbackMemoizer.jest.js +216 -0
- package/dist/es/utils/createCallbackMemoizer.js +25 -0
- package/dist/es/utils/getUpdatedOffsetForIndex.jest.js +65 -0
- package/dist/es/utils/getUpdatedOffsetForIndex.js +32 -0
- package/dist/es/utils/initCellMetadata.js +31 -0
- package/dist/es/utils/requestAnimationTimeout.js +32 -0
- package/dist/es/vendor/binarySearchBounds.js +194 -0
- package/dist/es/vendor/detectElementResize.js +186 -0
- package/dist/es/vendor/intervalTree.js +354 -0
- package/dist/umd/react-virtualized.js +4638 -0
- package/package.json +188 -0
- package/styles.css +80 -0
|
@@ -0,0 +1,743 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
12
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
14
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
15
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
16
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
17
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
18
|
+
var React = _interopRequireWildcard(require("react"));
|
|
19
|
+
var _reactLifecyclesCompat = require("react-lifecycles-compat");
|
|
20
|
+
var _CellMeasurerCacheDecorator = _interopRequireDefault(require("./CellMeasurerCacheDecorator"));
|
|
21
|
+
var _Grid = _interopRequireDefault(require("../Grid"));
|
|
22
|
+
var _excluded = ["rowIndex"],
|
|
23
|
+
_excluded2 = ["columnIndex", "rowIndex"],
|
|
24
|
+
_excluded3 = ["columnIndex"],
|
|
25
|
+
_excluded4 = ["onScroll", "onSectionRendered", "onScrollbarPresenceChange", "scrollLeft", "scrollToColumn", "scrollTop", "scrollToRow"];
|
|
26
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
27
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
28
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
29
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
30
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
31
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
32
|
+
var SCROLLBAR_SIZE_BUFFER = 20;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Renders 1, 2, or 4 Grids depending on configuration.
|
|
36
|
+
* A main (body) Grid will always be rendered.
|
|
37
|
+
* Optionally, 1-2 Grids for sticky header rows will also be rendered.
|
|
38
|
+
* If no sticky columns, only 1 sticky header Grid will be rendered.
|
|
39
|
+
* If sticky columns, 2 sticky header Grids will be rendered.
|
|
40
|
+
*/
|
|
41
|
+
var MultiGrid = /*#__PURE__*/function (_React$PureComponent) {
|
|
42
|
+
function MultiGrid(props, context) {
|
|
43
|
+
var _this;
|
|
44
|
+
(0, _classCallCheck2["default"])(this, MultiGrid);
|
|
45
|
+
_this = _callSuper(this, MultiGrid, [props, context]);
|
|
46
|
+
(0, _defineProperty2["default"])(_this, "state", {
|
|
47
|
+
scrollLeft: 0,
|
|
48
|
+
scrollTop: 0,
|
|
49
|
+
scrollbarSize: 0,
|
|
50
|
+
showHorizontalScrollbar: false,
|
|
51
|
+
showVerticalScrollbar: false
|
|
52
|
+
});
|
|
53
|
+
(0, _defineProperty2["default"])(_this, "_deferredInvalidateColumnIndex", null);
|
|
54
|
+
(0, _defineProperty2["default"])(_this, "_deferredInvalidateRowIndex", null);
|
|
55
|
+
(0, _defineProperty2["default"])(_this, "_bottomLeftGridRef", function (ref) {
|
|
56
|
+
_this._bottomLeftGrid = ref;
|
|
57
|
+
});
|
|
58
|
+
(0, _defineProperty2["default"])(_this, "_bottomRightGridRef", function (ref) {
|
|
59
|
+
_this._bottomRightGrid = ref;
|
|
60
|
+
});
|
|
61
|
+
(0, _defineProperty2["default"])(_this, "_cellRendererBottomLeftGrid", function (_ref) {
|
|
62
|
+
var rowIndex = _ref.rowIndex,
|
|
63
|
+
rest = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
64
|
+
var _this$props = _this.props,
|
|
65
|
+
cellRenderer = _this$props.cellRenderer,
|
|
66
|
+
fixedRowCount = _this$props.fixedRowCount,
|
|
67
|
+
rowCount = _this$props.rowCount;
|
|
68
|
+
if (rowIndex === rowCount - fixedRowCount) {
|
|
69
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
70
|
+
key: rest.key,
|
|
71
|
+
style: _objectSpread(_objectSpread({}, rest.style), {}, {
|
|
72
|
+
height: SCROLLBAR_SIZE_BUFFER
|
|
73
|
+
})
|
|
74
|
+
});
|
|
75
|
+
} else {
|
|
76
|
+
return cellRenderer(_objectSpread(_objectSpread({}, rest), {}, {
|
|
77
|
+
parent: _this,
|
|
78
|
+
rowIndex: rowIndex + fixedRowCount
|
|
79
|
+
}));
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
(0, _defineProperty2["default"])(_this, "_cellRendererBottomRightGrid", function (_ref2) {
|
|
83
|
+
var columnIndex = _ref2.columnIndex,
|
|
84
|
+
rowIndex = _ref2.rowIndex,
|
|
85
|
+
rest = (0, _objectWithoutProperties2["default"])(_ref2, _excluded2);
|
|
86
|
+
var _this$props2 = _this.props,
|
|
87
|
+
cellRenderer = _this$props2.cellRenderer,
|
|
88
|
+
fixedColumnCount = _this$props2.fixedColumnCount,
|
|
89
|
+
fixedRowCount = _this$props2.fixedRowCount;
|
|
90
|
+
return cellRenderer(_objectSpread(_objectSpread({}, rest), {}, {
|
|
91
|
+
columnIndex: columnIndex + fixedColumnCount,
|
|
92
|
+
parent: _this,
|
|
93
|
+
rowIndex: rowIndex + fixedRowCount
|
|
94
|
+
}));
|
|
95
|
+
});
|
|
96
|
+
(0, _defineProperty2["default"])(_this, "_cellRendererTopRightGrid", function (_ref3) {
|
|
97
|
+
var columnIndex = _ref3.columnIndex,
|
|
98
|
+
rest = (0, _objectWithoutProperties2["default"])(_ref3, _excluded3);
|
|
99
|
+
var _this$props3 = _this.props,
|
|
100
|
+
cellRenderer = _this$props3.cellRenderer,
|
|
101
|
+
columnCount = _this$props3.columnCount,
|
|
102
|
+
fixedColumnCount = _this$props3.fixedColumnCount;
|
|
103
|
+
if (columnIndex === columnCount - fixedColumnCount) {
|
|
104
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
105
|
+
key: rest.key,
|
|
106
|
+
style: _objectSpread(_objectSpread({}, rest.style), {}, {
|
|
107
|
+
width: SCROLLBAR_SIZE_BUFFER
|
|
108
|
+
})
|
|
109
|
+
});
|
|
110
|
+
} else {
|
|
111
|
+
return cellRenderer(_objectSpread(_objectSpread({}, rest), {}, {
|
|
112
|
+
columnIndex: columnIndex + fixedColumnCount,
|
|
113
|
+
parent: _this
|
|
114
|
+
}));
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
(0, _defineProperty2["default"])(_this, "_columnWidthRightGrid", function (_ref4) {
|
|
118
|
+
var index = _ref4.index;
|
|
119
|
+
var _this$props4 = _this.props,
|
|
120
|
+
columnCount = _this$props4.columnCount,
|
|
121
|
+
fixedColumnCount = _this$props4.fixedColumnCount,
|
|
122
|
+
columnWidth = _this$props4.columnWidth;
|
|
123
|
+
var _this$state = _this.state,
|
|
124
|
+
scrollbarSize = _this$state.scrollbarSize,
|
|
125
|
+
showHorizontalScrollbar = _this$state.showHorizontalScrollbar;
|
|
126
|
+
|
|
127
|
+
// An extra cell is added to the count
|
|
128
|
+
// This gives the smaller Grid extra room for offset,
|
|
129
|
+
// In case the main (bottom right) Grid has a scrollbar
|
|
130
|
+
// If no scrollbar, the extra space is overflow:hidden anyway
|
|
131
|
+
if (showHorizontalScrollbar && index === columnCount - fixedColumnCount) {
|
|
132
|
+
return scrollbarSize;
|
|
133
|
+
}
|
|
134
|
+
return typeof columnWidth === 'function' ? columnWidth({
|
|
135
|
+
index: index + fixedColumnCount
|
|
136
|
+
}) : columnWidth;
|
|
137
|
+
});
|
|
138
|
+
(0, _defineProperty2["default"])(_this, "_onScroll", function (scrollInfo) {
|
|
139
|
+
var scrollLeft = scrollInfo.scrollLeft,
|
|
140
|
+
scrollTop = scrollInfo.scrollTop;
|
|
141
|
+
_this.setState({
|
|
142
|
+
scrollLeft: scrollLeft,
|
|
143
|
+
scrollTop: scrollTop
|
|
144
|
+
});
|
|
145
|
+
var onScroll = _this.props.onScroll;
|
|
146
|
+
if (onScroll) {
|
|
147
|
+
onScroll(scrollInfo);
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
(0, _defineProperty2["default"])(_this, "_onScrollbarPresenceChange", function (_ref5) {
|
|
151
|
+
var horizontal = _ref5.horizontal,
|
|
152
|
+
size = _ref5.size,
|
|
153
|
+
vertical = _ref5.vertical;
|
|
154
|
+
var _this$state2 = _this.state,
|
|
155
|
+
showHorizontalScrollbar = _this$state2.showHorizontalScrollbar,
|
|
156
|
+
showVerticalScrollbar = _this$state2.showVerticalScrollbar;
|
|
157
|
+
if (horizontal !== showHorizontalScrollbar || vertical !== showVerticalScrollbar) {
|
|
158
|
+
_this.setState({
|
|
159
|
+
scrollbarSize: size,
|
|
160
|
+
showHorizontalScrollbar: horizontal,
|
|
161
|
+
showVerticalScrollbar: vertical
|
|
162
|
+
});
|
|
163
|
+
var onScrollbarPresenceChange = _this.props.onScrollbarPresenceChange;
|
|
164
|
+
if (typeof onScrollbarPresenceChange === 'function') {
|
|
165
|
+
onScrollbarPresenceChange({
|
|
166
|
+
horizontal: horizontal,
|
|
167
|
+
size: size,
|
|
168
|
+
vertical: vertical
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
(0, _defineProperty2["default"])(_this, "_onScrollLeft", function (scrollInfo) {
|
|
174
|
+
var scrollLeft = scrollInfo.scrollLeft;
|
|
175
|
+
_this._onScroll({
|
|
176
|
+
scrollLeft: scrollLeft,
|
|
177
|
+
scrollTop: _this.state.scrollTop
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
(0, _defineProperty2["default"])(_this, "_onScrollTop", function (scrollInfo) {
|
|
181
|
+
var scrollTop = scrollInfo.scrollTop;
|
|
182
|
+
_this._onScroll({
|
|
183
|
+
scrollTop: scrollTop,
|
|
184
|
+
scrollLeft: _this.state.scrollLeft
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
(0, _defineProperty2["default"])(_this, "_rowHeightBottomGrid", function (_ref6) {
|
|
188
|
+
var index = _ref6.index;
|
|
189
|
+
var _this$props5 = _this.props,
|
|
190
|
+
fixedRowCount = _this$props5.fixedRowCount,
|
|
191
|
+
rowCount = _this$props5.rowCount,
|
|
192
|
+
rowHeight = _this$props5.rowHeight;
|
|
193
|
+
var _this$state3 = _this.state,
|
|
194
|
+
scrollbarSize = _this$state3.scrollbarSize,
|
|
195
|
+
showVerticalScrollbar = _this$state3.showVerticalScrollbar;
|
|
196
|
+
|
|
197
|
+
// An extra cell is added to the count
|
|
198
|
+
// This gives the smaller Grid extra room for offset,
|
|
199
|
+
// In case the main (bottom right) Grid has a scrollbar
|
|
200
|
+
// If no scrollbar, the extra space is overflow:hidden anyway
|
|
201
|
+
if (showVerticalScrollbar && index === rowCount - fixedRowCount) {
|
|
202
|
+
return scrollbarSize;
|
|
203
|
+
}
|
|
204
|
+
return typeof rowHeight === 'function' ? rowHeight({
|
|
205
|
+
index: index + fixedRowCount
|
|
206
|
+
}) : rowHeight;
|
|
207
|
+
});
|
|
208
|
+
(0, _defineProperty2["default"])(_this, "_topLeftGridRef", function (ref) {
|
|
209
|
+
_this._topLeftGrid = ref;
|
|
210
|
+
});
|
|
211
|
+
(0, _defineProperty2["default"])(_this, "_topRightGridRef", function (ref) {
|
|
212
|
+
_this._topRightGrid = ref;
|
|
213
|
+
});
|
|
214
|
+
var deferredMeasurementCache = props.deferredMeasurementCache,
|
|
215
|
+
_fixedColumnCount = props.fixedColumnCount,
|
|
216
|
+
_fixedRowCount = props.fixedRowCount;
|
|
217
|
+
_this._maybeCalculateCachedStyles(true);
|
|
218
|
+
if (deferredMeasurementCache) {
|
|
219
|
+
_this._deferredMeasurementCacheBottomLeftGrid = _fixedRowCount > 0 ? new _CellMeasurerCacheDecorator["default"]({
|
|
220
|
+
cellMeasurerCache: deferredMeasurementCache,
|
|
221
|
+
columnIndexOffset: 0,
|
|
222
|
+
rowIndexOffset: _fixedRowCount
|
|
223
|
+
}) : deferredMeasurementCache;
|
|
224
|
+
_this._deferredMeasurementCacheBottomRightGrid = _fixedColumnCount > 0 || _fixedRowCount > 0 ? new _CellMeasurerCacheDecorator["default"]({
|
|
225
|
+
cellMeasurerCache: deferredMeasurementCache,
|
|
226
|
+
columnIndexOffset: _fixedColumnCount,
|
|
227
|
+
rowIndexOffset: _fixedRowCount
|
|
228
|
+
}) : deferredMeasurementCache;
|
|
229
|
+
_this._deferredMeasurementCacheTopRightGrid = _fixedColumnCount > 0 ? new _CellMeasurerCacheDecorator["default"]({
|
|
230
|
+
cellMeasurerCache: deferredMeasurementCache,
|
|
231
|
+
columnIndexOffset: _fixedColumnCount,
|
|
232
|
+
rowIndexOffset: 0
|
|
233
|
+
}) : deferredMeasurementCache;
|
|
234
|
+
}
|
|
235
|
+
return _this;
|
|
236
|
+
}
|
|
237
|
+
(0, _inherits2["default"])(MultiGrid, _React$PureComponent);
|
|
238
|
+
return (0, _createClass2["default"])(MultiGrid, [{
|
|
239
|
+
key: "forceUpdateGrids",
|
|
240
|
+
value: function forceUpdateGrids() {
|
|
241
|
+
this._bottomLeftGrid && this._bottomLeftGrid.forceUpdate();
|
|
242
|
+
this._bottomRightGrid && this._bottomRightGrid.forceUpdate();
|
|
243
|
+
this._topLeftGrid && this._topLeftGrid.forceUpdate();
|
|
244
|
+
this._topRightGrid && this._topRightGrid.forceUpdate();
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/** See Grid#invalidateCellSizeAfterRender */
|
|
248
|
+
}, {
|
|
249
|
+
key: "invalidateCellSizeAfterRender",
|
|
250
|
+
value: function invalidateCellSizeAfterRender() {
|
|
251
|
+
var _ref7 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
252
|
+
_ref7$columnIndex = _ref7.columnIndex,
|
|
253
|
+
columnIndex = _ref7$columnIndex === void 0 ? 0 : _ref7$columnIndex,
|
|
254
|
+
_ref7$rowIndex = _ref7.rowIndex,
|
|
255
|
+
rowIndex = _ref7$rowIndex === void 0 ? 0 : _ref7$rowIndex;
|
|
256
|
+
this._deferredInvalidateColumnIndex = typeof this._deferredInvalidateColumnIndex === 'number' ? Math.min(this._deferredInvalidateColumnIndex, columnIndex) : columnIndex;
|
|
257
|
+
this._deferredInvalidateRowIndex = typeof this._deferredInvalidateRowIndex === 'number' ? Math.min(this._deferredInvalidateRowIndex, rowIndex) : rowIndex;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/** See Grid#measureAllCells */
|
|
261
|
+
}, {
|
|
262
|
+
key: "measureAllCells",
|
|
263
|
+
value: function measureAllCells() {
|
|
264
|
+
this._bottomLeftGrid && this._bottomLeftGrid.measureAllCells();
|
|
265
|
+
this._bottomRightGrid && this._bottomRightGrid.measureAllCells();
|
|
266
|
+
this._topLeftGrid && this._topLeftGrid.measureAllCells();
|
|
267
|
+
this._topRightGrid && this._topRightGrid.measureAllCells();
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/** See Grid#recomputeGridSize */
|
|
271
|
+
}, {
|
|
272
|
+
key: "recomputeGridSize",
|
|
273
|
+
value: function recomputeGridSize() {
|
|
274
|
+
var _ref8 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
275
|
+
_ref8$columnIndex = _ref8.columnIndex,
|
|
276
|
+
columnIndex = _ref8$columnIndex === void 0 ? 0 : _ref8$columnIndex,
|
|
277
|
+
_ref8$rowIndex = _ref8.rowIndex,
|
|
278
|
+
rowIndex = _ref8$rowIndex === void 0 ? 0 : _ref8$rowIndex;
|
|
279
|
+
var _this$props6 = this.props,
|
|
280
|
+
fixedColumnCount = _this$props6.fixedColumnCount,
|
|
281
|
+
fixedRowCount = _this$props6.fixedRowCount;
|
|
282
|
+
var adjustedColumnIndex = Math.max(0, columnIndex - fixedColumnCount);
|
|
283
|
+
var adjustedRowIndex = Math.max(0, rowIndex - fixedRowCount);
|
|
284
|
+
this._bottomLeftGrid && this._bottomLeftGrid.recomputeGridSize({
|
|
285
|
+
columnIndex: columnIndex,
|
|
286
|
+
rowIndex: adjustedRowIndex
|
|
287
|
+
});
|
|
288
|
+
this._bottomRightGrid && this._bottomRightGrid.recomputeGridSize({
|
|
289
|
+
columnIndex: adjustedColumnIndex,
|
|
290
|
+
rowIndex: adjustedRowIndex
|
|
291
|
+
});
|
|
292
|
+
this._topLeftGrid && this._topLeftGrid.recomputeGridSize({
|
|
293
|
+
columnIndex: columnIndex,
|
|
294
|
+
rowIndex: rowIndex
|
|
295
|
+
});
|
|
296
|
+
this._topRightGrid && this._topRightGrid.recomputeGridSize({
|
|
297
|
+
columnIndex: adjustedColumnIndex,
|
|
298
|
+
rowIndex: rowIndex
|
|
299
|
+
});
|
|
300
|
+
this._leftGridWidth = null;
|
|
301
|
+
this._topGridHeight = null;
|
|
302
|
+
this._maybeCalculateCachedStyles(true);
|
|
303
|
+
}
|
|
304
|
+
}, {
|
|
305
|
+
key: "componentDidMount",
|
|
306
|
+
value: function componentDidMount() {
|
|
307
|
+
var _this$props7 = this.props,
|
|
308
|
+
scrollLeft = _this$props7.scrollLeft,
|
|
309
|
+
scrollTop = _this$props7.scrollTop;
|
|
310
|
+
if (scrollLeft > 0 || scrollTop > 0) {
|
|
311
|
+
var newState = {};
|
|
312
|
+
if (scrollLeft > 0) {
|
|
313
|
+
newState.scrollLeft = scrollLeft;
|
|
314
|
+
}
|
|
315
|
+
if (scrollTop > 0) {
|
|
316
|
+
newState.scrollTop = scrollTop;
|
|
317
|
+
}
|
|
318
|
+
this.setState(newState);
|
|
319
|
+
}
|
|
320
|
+
this._handleInvalidatedGridSize();
|
|
321
|
+
}
|
|
322
|
+
}, {
|
|
323
|
+
key: "componentDidUpdate",
|
|
324
|
+
value: function componentDidUpdate() {
|
|
325
|
+
this._handleInvalidatedGridSize();
|
|
326
|
+
}
|
|
327
|
+
}, {
|
|
328
|
+
key: "render",
|
|
329
|
+
value: function render() {
|
|
330
|
+
var _this$props8 = this.props,
|
|
331
|
+
onScroll = _this$props8.onScroll,
|
|
332
|
+
onSectionRendered = _this$props8.onSectionRendered,
|
|
333
|
+
onScrollbarPresenceChange = _this$props8.onScrollbarPresenceChange,
|
|
334
|
+
scrollLeftProp = _this$props8.scrollLeft,
|
|
335
|
+
scrollToColumn = _this$props8.scrollToColumn,
|
|
336
|
+
scrollTopProp = _this$props8.scrollTop,
|
|
337
|
+
scrollToRow = _this$props8.scrollToRow,
|
|
338
|
+
rest = (0, _objectWithoutProperties2["default"])(_this$props8, _excluded4);
|
|
339
|
+
this._prepareForRender();
|
|
340
|
+
|
|
341
|
+
// Don't render any of our Grids if there are no cells.
|
|
342
|
+
// This mirrors what Grid does,
|
|
343
|
+
// And prevents us from recording inaccurage measurements when used with CellMeasurer.
|
|
344
|
+
if (this.props.width === 0 || this.props.height === 0) {
|
|
345
|
+
return null;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
// scrollTop and scrollLeft props are explicitly filtered out and ignored
|
|
349
|
+
|
|
350
|
+
var _this$state4 = this.state,
|
|
351
|
+
scrollLeft = _this$state4.scrollLeft,
|
|
352
|
+
scrollTop = _this$state4.scrollTop;
|
|
353
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
354
|
+
style: this._containerOuterStyle
|
|
355
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
356
|
+
style: this._containerTopStyle
|
|
357
|
+
}, this._renderTopLeftGrid(rest), this._renderTopRightGrid(_objectSpread(_objectSpread({}, rest), {}, {
|
|
358
|
+
onScroll: onScroll,
|
|
359
|
+
scrollLeft: scrollLeft
|
|
360
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
361
|
+
style: this._containerBottomStyle
|
|
362
|
+
}, this._renderBottomLeftGrid(_objectSpread(_objectSpread({}, rest), {}, {
|
|
363
|
+
onScroll: onScroll,
|
|
364
|
+
scrollTop: scrollTop
|
|
365
|
+
})), this._renderBottomRightGrid(_objectSpread(_objectSpread({}, rest), {}, {
|
|
366
|
+
onScroll: onScroll,
|
|
367
|
+
onSectionRendered: onSectionRendered,
|
|
368
|
+
scrollLeft: scrollLeft,
|
|
369
|
+
scrollToColumn: scrollToColumn,
|
|
370
|
+
scrollToRow: scrollToRow,
|
|
371
|
+
scrollTop: scrollTop
|
|
372
|
+
}))));
|
|
373
|
+
}
|
|
374
|
+
}, {
|
|
375
|
+
key: "_getBottomGridHeight",
|
|
376
|
+
value: function _getBottomGridHeight(props) {
|
|
377
|
+
var height = props.height;
|
|
378
|
+
var topGridHeight = this._getTopGridHeight(props);
|
|
379
|
+
return height - topGridHeight;
|
|
380
|
+
}
|
|
381
|
+
}, {
|
|
382
|
+
key: "_getLeftGridWidth",
|
|
383
|
+
value: function _getLeftGridWidth(props) {
|
|
384
|
+
var fixedColumnCount = props.fixedColumnCount,
|
|
385
|
+
columnWidth = props.columnWidth;
|
|
386
|
+
if (this._leftGridWidth == null) {
|
|
387
|
+
if (typeof columnWidth === 'function') {
|
|
388
|
+
var leftGridWidth = 0;
|
|
389
|
+
for (var index = 0; index < fixedColumnCount; index++) {
|
|
390
|
+
leftGridWidth += columnWidth({
|
|
391
|
+
index: index
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
this._leftGridWidth = leftGridWidth;
|
|
395
|
+
} else {
|
|
396
|
+
this._leftGridWidth = columnWidth * fixedColumnCount;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
return this._leftGridWidth;
|
|
400
|
+
}
|
|
401
|
+
}, {
|
|
402
|
+
key: "_getRightGridWidth",
|
|
403
|
+
value: function _getRightGridWidth(props) {
|
|
404
|
+
var width = props.width;
|
|
405
|
+
var leftGridWidth = this._getLeftGridWidth(props);
|
|
406
|
+
return width - leftGridWidth;
|
|
407
|
+
}
|
|
408
|
+
}, {
|
|
409
|
+
key: "_getTopGridHeight",
|
|
410
|
+
value: function _getTopGridHeight(props) {
|
|
411
|
+
var fixedRowCount = props.fixedRowCount,
|
|
412
|
+
rowHeight = props.rowHeight;
|
|
413
|
+
if (this._topGridHeight == null) {
|
|
414
|
+
if (typeof rowHeight === 'function') {
|
|
415
|
+
var topGridHeight = 0;
|
|
416
|
+
for (var index = 0; index < fixedRowCount; index++) {
|
|
417
|
+
topGridHeight += rowHeight({
|
|
418
|
+
index: index
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
this._topGridHeight = topGridHeight;
|
|
422
|
+
} else {
|
|
423
|
+
this._topGridHeight = rowHeight * fixedRowCount;
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
return this._topGridHeight;
|
|
427
|
+
}
|
|
428
|
+
}, {
|
|
429
|
+
key: "_handleInvalidatedGridSize",
|
|
430
|
+
value: function _handleInvalidatedGridSize() {
|
|
431
|
+
if (typeof this._deferredInvalidateColumnIndex === 'number') {
|
|
432
|
+
var columnIndex = this._deferredInvalidateColumnIndex;
|
|
433
|
+
var rowIndex = this._deferredInvalidateRowIndex;
|
|
434
|
+
this._deferredInvalidateColumnIndex = null;
|
|
435
|
+
this._deferredInvalidateRowIndex = null;
|
|
436
|
+
this.recomputeGridSize({
|
|
437
|
+
columnIndex: columnIndex,
|
|
438
|
+
rowIndex: rowIndex
|
|
439
|
+
});
|
|
440
|
+
this.forceUpdate();
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* Avoid recreating inline styles each render; this bypasses Grid's shallowCompare.
|
|
446
|
+
* This method recalculates styles only when specific props change.
|
|
447
|
+
*/
|
|
448
|
+
}, {
|
|
449
|
+
key: "_maybeCalculateCachedStyles",
|
|
450
|
+
value: function _maybeCalculateCachedStyles(resetAll) {
|
|
451
|
+
var _this$props9 = this.props,
|
|
452
|
+
columnWidth = _this$props9.columnWidth,
|
|
453
|
+
enableFixedColumnScroll = _this$props9.enableFixedColumnScroll,
|
|
454
|
+
enableFixedRowScroll = _this$props9.enableFixedRowScroll,
|
|
455
|
+
height = _this$props9.height,
|
|
456
|
+
fixedColumnCount = _this$props9.fixedColumnCount,
|
|
457
|
+
fixedRowCount = _this$props9.fixedRowCount,
|
|
458
|
+
rowHeight = _this$props9.rowHeight,
|
|
459
|
+
style = _this$props9.style,
|
|
460
|
+
styleBottomLeftGrid = _this$props9.styleBottomLeftGrid,
|
|
461
|
+
styleBottomRightGrid = _this$props9.styleBottomRightGrid,
|
|
462
|
+
styleTopLeftGrid = _this$props9.styleTopLeftGrid,
|
|
463
|
+
styleTopRightGrid = _this$props9.styleTopRightGrid,
|
|
464
|
+
width = _this$props9.width;
|
|
465
|
+
var sizeChange = resetAll || height !== this._lastRenderedHeight || width !== this._lastRenderedWidth;
|
|
466
|
+
var leftSizeChange = resetAll || columnWidth !== this._lastRenderedColumnWidth || fixedColumnCount !== this._lastRenderedFixedColumnCount;
|
|
467
|
+
var topSizeChange = resetAll || fixedRowCount !== this._lastRenderedFixedRowCount || rowHeight !== this._lastRenderedRowHeight;
|
|
468
|
+
if (resetAll || sizeChange || style !== this._lastRenderedStyle) {
|
|
469
|
+
this._containerOuterStyle = _objectSpread({
|
|
470
|
+
height: height,
|
|
471
|
+
overflow: 'visible',
|
|
472
|
+
// Let :focus outline show through
|
|
473
|
+
width: width
|
|
474
|
+
}, style);
|
|
475
|
+
}
|
|
476
|
+
if (resetAll || sizeChange || topSizeChange) {
|
|
477
|
+
this._containerTopStyle = {
|
|
478
|
+
height: this._getTopGridHeight(this.props),
|
|
479
|
+
position: 'relative',
|
|
480
|
+
width: width
|
|
481
|
+
};
|
|
482
|
+
this._containerBottomStyle = {
|
|
483
|
+
height: height - this._getTopGridHeight(this.props),
|
|
484
|
+
overflow: 'visible',
|
|
485
|
+
// Let :focus outline show through
|
|
486
|
+
position: 'relative',
|
|
487
|
+
width: width
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
if (resetAll || styleBottomLeftGrid !== this._lastRenderedStyleBottomLeftGrid) {
|
|
491
|
+
this._bottomLeftGridStyle = _objectSpread({
|
|
492
|
+
left: 0,
|
|
493
|
+
overflowX: 'hidden',
|
|
494
|
+
overflowY: enableFixedColumnScroll ? 'auto' : 'hidden',
|
|
495
|
+
position: 'absolute'
|
|
496
|
+
}, styleBottomLeftGrid);
|
|
497
|
+
}
|
|
498
|
+
if (resetAll || leftSizeChange || styleBottomRightGrid !== this._lastRenderedStyleBottomRightGrid) {
|
|
499
|
+
this._bottomRightGridStyle = _objectSpread({
|
|
500
|
+
left: this._getLeftGridWidth(this.props),
|
|
501
|
+
position: 'absolute'
|
|
502
|
+
}, styleBottomRightGrid);
|
|
503
|
+
}
|
|
504
|
+
if (resetAll || styleTopLeftGrid !== this._lastRenderedStyleTopLeftGrid) {
|
|
505
|
+
this._topLeftGridStyle = _objectSpread({
|
|
506
|
+
left: 0,
|
|
507
|
+
overflowX: 'hidden',
|
|
508
|
+
overflowY: 'hidden',
|
|
509
|
+
position: 'absolute',
|
|
510
|
+
top: 0
|
|
511
|
+
}, styleTopLeftGrid);
|
|
512
|
+
}
|
|
513
|
+
if (resetAll || leftSizeChange || styleTopRightGrid !== this._lastRenderedStyleTopRightGrid) {
|
|
514
|
+
this._topRightGridStyle = _objectSpread({
|
|
515
|
+
left: this._getLeftGridWidth(this.props),
|
|
516
|
+
overflowX: enableFixedRowScroll ? 'auto' : 'hidden',
|
|
517
|
+
overflowY: 'hidden',
|
|
518
|
+
position: 'absolute',
|
|
519
|
+
top: 0
|
|
520
|
+
}, styleTopRightGrid);
|
|
521
|
+
}
|
|
522
|
+
this._lastRenderedColumnWidth = columnWidth;
|
|
523
|
+
this._lastRenderedFixedColumnCount = fixedColumnCount;
|
|
524
|
+
this._lastRenderedFixedRowCount = fixedRowCount;
|
|
525
|
+
this._lastRenderedHeight = height;
|
|
526
|
+
this._lastRenderedRowHeight = rowHeight;
|
|
527
|
+
this._lastRenderedStyle = style;
|
|
528
|
+
this._lastRenderedStyleBottomLeftGrid = styleBottomLeftGrid;
|
|
529
|
+
this._lastRenderedStyleBottomRightGrid = styleBottomRightGrid;
|
|
530
|
+
this._lastRenderedStyleTopLeftGrid = styleTopLeftGrid;
|
|
531
|
+
this._lastRenderedStyleTopRightGrid = styleTopRightGrid;
|
|
532
|
+
this._lastRenderedWidth = width;
|
|
533
|
+
}
|
|
534
|
+
}, {
|
|
535
|
+
key: "_prepareForRender",
|
|
536
|
+
value: function _prepareForRender() {
|
|
537
|
+
if (this._lastRenderedColumnWidth !== this.props.columnWidth || this._lastRenderedFixedColumnCount !== this.props.fixedColumnCount) {
|
|
538
|
+
this._leftGridWidth = null;
|
|
539
|
+
}
|
|
540
|
+
if (this._lastRenderedFixedRowCount !== this.props.fixedRowCount || this._lastRenderedRowHeight !== this.props.rowHeight) {
|
|
541
|
+
this._topGridHeight = null;
|
|
542
|
+
}
|
|
543
|
+
this._maybeCalculateCachedStyles();
|
|
544
|
+
this._lastRenderedColumnWidth = this.props.columnWidth;
|
|
545
|
+
this._lastRenderedFixedColumnCount = this.props.fixedColumnCount;
|
|
546
|
+
this._lastRenderedFixedRowCount = this.props.fixedRowCount;
|
|
547
|
+
this._lastRenderedRowHeight = this.props.rowHeight;
|
|
548
|
+
}
|
|
549
|
+
}, {
|
|
550
|
+
key: "_renderBottomLeftGrid",
|
|
551
|
+
value: function _renderBottomLeftGrid(props) {
|
|
552
|
+
var enableFixedColumnScroll = props.enableFixedColumnScroll,
|
|
553
|
+
fixedColumnCount = props.fixedColumnCount,
|
|
554
|
+
fixedRowCount = props.fixedRowCount,
|
|
555
|
+
rowCount = props.rowCount,
|
|
556
|
+
hideBottomLeftGridScrollbar = props.hideBottomLeftGridScrollbar;
|
|
557
|
+
var showVerticalScrollbar = this.state.showVerticalScrollbar;
|
|
558
|
+
if (!fixedColumnCount) {
|
|
559
|
+
return null;
|
|
560
|
+
}
|
|
561
|
+
var additionalRowCount = showVerticalScrollbar ? 1 : 0,
|
|
562
|
+
height = this._getBottomGridHeight(props),
|
|
563
|
+
width = this._getLeftGridWidth(props),
|
|
564
|
+
scrollbarSize = this.state.showVerticalScrollbar ? this.state.scrollbarSize : 0,
|
|
565
|
+
gridWidth = hideBottomLeftGridScrollbar ? width + scrollbarSize : width;
|
|
566
|
+
var bottomLeftGrid = /*#__PURE__*/React.createElement(_Grid["default"], (0, _extends2["default"])({}, props, {
|
|
567
|
+
cellRenderer: this._cellRendererBottomLeftGrid,
|
|
568
|
+
className: this.props.classNameBottomLeftGrid,
|
|
569
|
+
columnCount: fixedColumnCount,
|
|
570
|
+
deferredMeasurementCache: this._deferredMeasurementCacheBottomLeftGrid,
|
|
571
|
+
height: height,
|
|
572
|
+
onScroll: enableFixedColumnScroll ? this._onScrollTop : undefined,
|
|
573
|
+
ref: this._bottomLeftGridRef,
|
|
574
|
+
rowCount: Math.max(0, rowCount - fixedRowCount) + additionalRowCount,
|
|
575
|
+
rowHeight: this._rowHeightBottomGrid,
|
|
576
|
+
style: this._bottomLeftGridStyle,
|
|
577
|
+
tabIndex: null,
|
|
578
|
+
width: gridWidth
|
|
579
|
+
}));
|
|
580
|
+
if (hideBottomLeftGridScrollbar) {
|
|
581
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
582
|
+
className: "BottomLeftGrid_ScrollWrapper",
|
|
583
|
+
style: _objectSpread(_objectSpread({}, this._bottomLeftGridStyle), {}, {
|
|
584
|
+
height: height,
|
|
585
|
+
width: width,
|
|
586
|
+
overflowY: 'hidden'
|
|
587
|
+
})
|
|
588
|
+
}, bottomLeftGrid);
|
|
589
|
+
}
|
|
590
|
+
return bottomLeftGrid;
|
|
591
|
+
}
|
|
592
|
+
}, {
|
|
593
|
+
key: "_renderBottomRightGrid",
|
|
594
|
+
value: function _renderBottomRightGrid(props) {
|
|
595
|
+
var columnCount = props.columnCount,
|
|
596
|
+
fixedColumnCount = props.fixedColumnCount,
|
|
597
|
+
fixedRowCount = props.fixedRowCount,
|
|
598
|
+
rowCount = props.rowCount,
|
|
599
|
+
scrollToColumn = props.scrollToColumn,
|
|
600
|
+
scrollToRow = props.scrollToRow;
|
|
601
|
+
return /*#__PURE__*/React.createElement(_Grid["default"], (0, _extends2["default"])({}, props, {
|
|
602
|
+
cellRenderer: this._cellRendererBottomRightGrid,
|
|
603
|
+
className: this.props.classNameBottomRightGrid,
|
|
604
|
+
columnCount: Math.max(0, columnCount - fixedColumnCount),
|
|
605
|
+
columnWidth: this._columnWidthRightGrid,
|
|
606
|
+
deferredMeasurementCache: this._deferredMeasurementCacheBottomRightGrid,
|
|
607
|
+
height: this._getBottomGridHeight(props),
|
|
608
|
+
onScroll: this._onScroll,
|
|
609
|
+
onScrollbarPresenceChange: this._onScrollbarPresenceChange,
|
|
610
|
+
ref: this._bottomRightGridRef,
|
|
611
|
+
rowCount: Math.max(0, rowCount - fixedRowCount),
|
|
612
|
+
rowHeight: this._rowHeightBottomGrid,
|
|
613
|
+
scrollToColumn: scrollToColumn - fixedColumnCount,
|
|
614
|
+
scrollToRow: scrollToRow - fixedRowCount,
|
|
615
|
+
style: this._bottomRightGridStyle,
|
|
616
|
+
width: this._getRightGridWidth(props)
|
|
617
|
+
}));
|
|
618
|
+
}
|
|
619
|
+
}, {
|
|
620
|
+
key: "_renderTopLeftGrid",
|
|
621
|
+
value: function _renderTopLeftGrid(props) {
|
|
622
|
+
var fixedColumnCount = props.fixedColumnCount,
|
|
623
|
+
fixedRowCount = props.fixedRowCount;
|
|
624
|
+
if (!fixedColumnCount || !fixedRowCount) {
|
|
625
|
+
return null;
|
|
626
|
+
}
|
|
627
|
+
return /*#__PURE__*/React.createElement(_Grid["default"], (0, _extends2["default"])({}, props, {
|
|
628
|
+
className: this.props.classNameTopLeftGrid,
|
|
629
|
+
columnCount: fixedColumnCount,
|
|
630
|
+
height: this._getTopGridHeight(props),
|
|
631
|
+
ref: this._topLeftGridRef,
|
|
632
|
+
rowCount: fixedRowCount,
|
|
633
|
+
style: this._topLeftGridStyle,
|
|
634
|
+
tabIndex: null,
|
|
635
|
+
width: this._getLeftGridWidth(props)
|
|
636
|
+
}));
|
|
637
|
+
}
|
|
638
|
+
}, {
|
|
639
|
+
key: "_renderTopRightGrid",
|
|
640
|
+
value: function _renderTopRightGrid(props) {
|
|
641
|
+
var columnCount = props.columnCount,
|
|
642
|
+
enableFixedRowScroll = props.enableFixedRowScroll,
|
|
643
|
+
fixedColumnCount = props.fixedColumnCount,
|
|
644
|
+
fixedRowCount = props.fixedRowCount,
|
|
645
|
+
scrollLeft = props.scrollLeft,
|
|
646
|
+
hideTopRightGridScrollbar = props.hideTopRightGridScrollbar;
|
|
647
|
+
var _this$state5 = this.state,
|
|
648
|
+
showHorizontalScrollbar = _this$state5.showHorizontalScrollbar,
|
|
649
|
+
scrollbarSize = _this$state5.scrollbarSize;
|
|
650
|
+
if (!fixedRowCount) {
|
|
651
|
+
return null;
|
|
652
|
+
}
|
|
653
|
+
var additionalColumnCount = showHorizontalScrollbar ? 1 : 0,
|
|
654
|
+
height = this._getTopGridHeight(props),
|
|
655
|
+
width = this._getRightGridWidth(props),
|
|
656
|
+
additionalHeight = showHorizontalScrollbar ? scrollbarSize : 0;
|
|
657
|
+
var gridHeight = height,
|
|
658
|
+
style = this._topRightGridStyle;
|
|
659
|
+
if (hideTopRightGridScrollbar) {
|
|
660
|
+
gridHeight = height + additionalHeight;
|
|
661
|
+
style = _objectSpread(_objectSpread({}, this._topRightGridStyle), {}, {
|
|
662
|
+
left: 0
|
|
663
|
+
});
|
|
664
|
+
}
|
|
665
|
+
var topRightGrid = /*#__PURE__*/React.createElement(_Grid["default"], (0, _extends2["default"])({}, props, {
|
|
666
|
+
cellRenderer: this._cellRendererTopRightGrid,
|
|
667
|
+
className: this.props.classNameTopRightGrid,
|
|
668
|
+
columnCount: Math.max(0, columnCount - fixedColumnCount) + additionalColumnCount,
|
|
669
|
+
columnWidth: this._columnWidthRightGrid,
|
|
670
|
+
deferredMeasurementCache: this._deferredMeasurementCacheTopRightGrid,
|
|
671
|
+
height: gridHeight,
|
|
672
|
+
onScroll: enableFixedRowScroll ? this._onScrollLeft : undefined,
|
|
673
|
+
ref: this._topRightGridRef,
|
|
674
|
+
rowCount: fixedRowCount,
|
|
675
|
+
scrollLeft: scrollLeft,
|
|
676
|
+
style: style,
|
|
677
|
+
tabIndex: null,
|
|
678
|
+
width: width
|
|
679
|
+
}));
|
|
680
|
+
if (hideTopRightGridScrollbar) {
|
|
681
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
682
|
+
className: "TopRightGrid_ScrollWrapper",
|
|
683
|
+
style: _objectSpread(_objectSpread({}, this._topRightGridStyle), {}, {
|
|
684
|
+
height: height,
|
|
685
|
+
width: width,
|
|
686
|
+
overflowX: 'hidden'
|
|
687
|
+
})
|
|
688
|
+
}, topRightGrid);
|
|
689
|
+
}
|
|
690
|
+
return topRightGrid;
|
|
691
|
+
}
|
|
692
|
+
}], [{
|
|
693
|
+
key: "getDerivedStateFromProps",
|
|
694
|
+
value: function getDerivedStateFromProps(nextProps, prevState) {
|
|
695
|
+
if (nextProps.scrollLeft !== prevState.scrollLeft || nextProps.scrollTop !== prevState.scrollTop) {
|
|
696
|
+
return {
|
|
697
|
+
scrollLeft: nextProps.scrollLeft != null && nextProps.scrollLeft >= 0 ? nextProps.scrollLeft : prevState.scrollLeft,
|
|
698
|
+
scrollTop: nextProps.scrollTop != null && nextProps.scrollTop >= 0 ? nextProps.scrollTop : prevState.scrollTop
|
|
699
|
+
};
|
|
700
|
+
}
|
|
701
|
+
return null;
|
|
702
|
+
}
|
|
703
|
+
}]);
|
|
704
|
+
}(React.PureComponent);
|
|
705
|
+
(0, _defineProperty2["default"])(MultiGrid, "defaultProps", {
|
|
706
|
+
classNameBottomLeftGrid: '',
|
|
707
|
+
classNameBottomRightGrid: '',
|
|
708
|
+
classNameTopLeftGrid: '',
|
|
709
|
+
classNameTopRightGrid: '',
|
|
710
|
+
enableFixedColumnScroll: false,
|
|
711
|
+
enableFixedRowScroll: false,
|
|
712
|
+
fixedColumnCount: 0,
|
|
713
|
+
fixedRowCount: 0,
|
|
714
|
+
scrollToColumn: -1,
|
|
715
|
+
scrollToRow: -1,
|
|
716
|
+
style: {},
|
|
717
|
+
styleBottomLeftGrid: {},
|
|
718
|
+
styleBottomRightGrid: {},
|
|
719
|
+
styleTopLeftGrid: {},
|
|
720
|
+
styleTopRightGrid: {},
|
|
721
|
+
hideTopRightGridScrollbar: false,
|
|
722
|
+
hideBottomLeftGridScrollbar: false
|
|
723
|
+
});
|
|
724
|
+
MultiGrid.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
725
|
+
classNameBottomLeftGrid: _propTypes["default"].string.isRequired,
|
|
726
|
+
classNameBottomRightGrid: _propTypes["default"].string.isRequired,
|
|
727
|
+
classNameTopLeftGrid: _propTypes["default"].string.isRequired,
|
|
728
|
+
classNameTopRightGrid: _propTypes["default"].string.isRequired,
|
|
729
|
+
enableFixedColumnScroll: _propTypes["default"].bool.isRequired,
|
|
730
|
+
enableFixedRowScroll: _propTypes["default"].bool.isRequired,
|
|
731
|
+
fixedColumnCount: _propTypes["default"].number.isRequired,
|
|
732
|
+
fixedRowCount: _propTypes["default"].number.isRequired,
|
|
733
|
+
onScrollbarPresenceChange: _propTypes["default"].func,
|
|
734
|
+
style: _propTypes["default"].object.isRequired,
|
|
735
|
+
styleBottomLeftGrid: _propTypes["default"].object.isRequired,
|
|
736
|
+
styleBottomRightGrid: _propTypes["default"].object.isRequired,
|
|
737
|
+
styleTopLeftGrid: _propTypes["default"].object.isRequired,
|
|
738
|
+
styleTopRightGrid: _propTypes["default"].object.isRequired,
|
|
739
|
+
hideTopRightGridScrollbar: _propTypes["default"].bool,
|
|
740
|
+
hideBottomLeftGridScrollbar: _propTypes["default"].bool
|
|
741
|
+
} : {};
|
|
742
|
+
(0, _reactLifecyclesCompat.polyfill)(MultiGrid);
|
|
743
|
+
var _default = exports["default"] = MultiGrid;
|