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