box-ui-elements 20.1.0-beta.3 → 21.0.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/dist/explorer.js +827 -888
- package/dist/picker.js +619 -634
- package/dist/sharing.js +4298 -696
- package/dist/uploader.js +617 -632
- package/package.json +5 -6
package/dist/picker.js
CHANGED
|
@@ -47577,11 +47577,10 @@ const makeDroppable = ({
|
|
|
47577
47577
|
;// CONCATENATED MODULE: ./node_modules/@box/react-virtualized/dist/es/Table/defaultHeaderRowRenderer.js
|
|
47578
47578
|
|
|
47579
47579
|
/*:: import type {HeaderRowRendererParams} from './types';*/
|
|
47580
|
-
|
|
47581
|
-
|
|
47582
|
-
|
|
47583
|
-
|
|
47584
|
-
style = _ref.style;
|
|
47580
|
+
function defaultHeaderRowRenderer(_ref /*:: */) {
|
|
47581
|
+
var className = _ref /*:: */.className,
|
|
47582
|
+
columns = _ref /*:: */.columns,
|
|
47583
|
+
style = _ref /*:: */.style;
|
|
47585
47584
|
return /*#__PURE__*/react.createElement("div", {
|
|
47586
47585
|
role: "rowgroup",
|
|
47587
47586
|
className: "ReactVirtualized__Table__headerRowGroup"
|
|
@@ -47623,10 +47622,10 @@ var SortDirection = {
|
|
|
47623
47622
|
|
|
47624
47623
|
|
|
47625
47624
|
|
|
47625
|
+
|
|
47626
47626
|
/**
|
|
47627
47627
|
* Displayed beside a header to indicate that a Table is currently sorted by this column.
|
|
47628
47628
|
*/
|
|
47629
|
-
|
|
47630
47629
|
function SortIndicator(_ref) {
|
|
47631
47630
|
var sortDirection = _ref.sortDirection;
|
|
47632
47631
|
var classNames = clsx_m('ReactVirtualized__Table__sortableHeaderIcon', {
|
|
@@ -47652,15 +47651,14 @@ SortIndicator.propTypes = false ? 0 : {};
|
|
|
47652
47651
|
|
|
47653
47652
|
|
|
47654
47653
|
/*:: import type {HeaderRendererParams} from './types';*/
|
|
47655
|
-
|
|
47656
47654
|
/**
|
|
47657
47655
|
* Default table header renderer.
|
|
47658
47656
|
*/
|
|
47659
|
-
function defaultHeaderRenderer(_ref) {
|
|
47660
|
-
var dataKey = _ref
|
|
47661
|
-
label = _ref
|
|
47662
|
-
sortBy = _ref
|
|
47663
|
-
sortDirection = _ref
|
|
47657
|
+
function defaultHeaderRenderer(_ref /*:: */) {
|
|
47658
|
+
var dataKey = _ref /*:: */.dataKey,
|
|
47659
|
+
label = _ref /*:: */.label,
|
|
47660
|
+
sortBy = _ref /*:: */.sortBy,
|
|
47661
|
+
sortDirection = _ref /*:: */.sortDirection;
|
|
47664
47662
|
var showSortIndicator = sortBy === dataKey;
|
|
47665
47663
|
var children = [/*#__PURE__*/react.createElement("span", {
|
|
47666
47664
|
className: "ReactVirtualized__Table__headerTruncatedText",
|
|
@@ -47679,22 +47677,21 @@ function defaultHeaderRenderer(_ref) {
|
|
|
47679
47677
|
|
|
47680
47678
|
|
|
47681
47679
|
/*:: import type {RowRendererParams} from './types';*/
|
|
47682
|
-
|
|
47683
47680
|
/**
|
|
47684
47681
|
* Default row renderer for Table.
|
|
47685
47682
|
*/
|
|
47686
|
-
function defaultRowRenderer(_ref) {
|
|
47687
|
-
var className = _ref
|
|
47688
|
-
columns = _ref
|
|
47689
|
-
index = _ref
|
|
47690
|
-
key = _ref
|
|
47691
|
-
onRowClick = _ref
|
|
47692
|
-
onRowDoubleClick = _ref
|
|
47693
|
-
onRowMouseOut = _ref
|
|
47694
|
-
onRowMouseOver = _ref
|
|
47695
|
-
onRowRightClick = _ref
|
|
47696
|
-
rowData = _ref
|
|
47697
|
-
style = _ref
|
|
47683
|
+
function defaultRowRenderer(_ref /*:: */) {
|
|
47684
|
+
var className = _ref /*:: */.className,
|
|
47685
|
+
columns = _ref /*:: */.columns,
|
|
47686
|
+
index = _ref /*:: */.index,
|
|
47687
|
+
key = _ref /*:: */.key,
|
|
47688
|
+
onRowClick = _ref /*:: */.onRowClick,
|
|
47689
|
+
onRowDoubleClick = _ref /*:: */.onRowDoubleClick,
|
|
47690
|
+
onRowMouseOut = _ref /*:: */.onRowMouseOut,
|
|
47691
|
+
onRowMouseOver = _ref /*:: */.onRowMouseOver,
|
|
47692
|
+
onRowRightClick = _ref /*:: */.onRowRightClick,
|
|
47693
|
+
rowData = _ref /*:: */.rowData,
|
|
47694
|
+
style = _ref /*:: */.style;
|
|
47698
47695
|
var a11yProps = {
|
|
47699
47696
|
'aria-rowindex': index + 1
|
|
47700
47697
|
};
|
|
@@ -47753,11 +47750,6 @@ function defaultRowRenderer(_ref) {
|
|
|
47753
47750
|
style: style
|
|
47754
47751
|
}), columns);
|
|
47755
47752
|
}
|
|
47756
|
-
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
|
|
47757
|
-
function _classCallCheck(a, n) {
|
|
47758
|
-
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
47759
|
-
}
|
|
47760
|
-
|
|
47761
47753
|
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
|
|
47762
47754
|
function _typeof(o) {
|
|
47763
47755
|
"@babel/helpers - typeof";
|
|
@@ -47769,6 +47761,46 @@ function _typeof(o) {
|
|
|
47769
47761
|
}, _typeof(o);
|
|
47770
47762
|
}
|
|
47771
47763
|
|
|
47764
|
+
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toPrimitive.js
|
|
47765
|
+
|
|
47766
|
+
function toPrimitive(t, r) {
|
|
47767
|
+
if ("object" != _typeof(t) || !t) return t;
|
|
47768
|
+
var e = t[Symbol.toPrimitive];
|
|
47769
|
+
if (void 0 !== e) {
|
|
47770
|
+
var i = e.call(t, r || "default");
|
|
47771
|
+
if ("object" != _typeof(i)) return i;
|
|
47772
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
47773
|
+
}
|
|
47774
|
+
return ("string" === r ? String : Number)(t);
|
|
47775
|
+
}
|
|
47776
|
+
|
|
47777
|
+
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
|
|
47778
|
+
|
|
47779
|
+
|
|
47780
|
+
function toPropertyKey(t) {
|
|
47781
|
+
var i = toPrimitive(t, "string");
|
|
47782
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
|
47783
|
+
}
|
|
47784
|
+
|
|
47785
|
+
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
|
|
47786
|
+
|
|
47787
|
+
function _defineProperties(e, r) {
|
|
47788
|
+
for (var t = 0; t < r.length; t++) {
|
|
47789
|
+
var o = r[t];
|
|
47790
|
+
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o);
|
|
47791
|
+
}
|
|
47792
|
+
}
|
|
47793
|
+
function _createClass(e, r, t) {
|
|
47794
|
+
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
47795
|
+
writable: !1
|
|
47796
|
+
}), e;
|
|
47797
|
+
}
|
|
47798
|
+
|
|
47799
|
+
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
|
|
47800
|
+
function _classCallCheck(a, n) {
|
|
47801
|
+
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
47802
|
+
}
|
|
47803
|
+
|
|
47772
47804
|
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
|
|
47773
47805
|
function _assertThisInitialized(e) {
|
|
47774
47806
|
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
@@ -47806,27 +47838,6 @@ function _inherits(t, e) {
|
|
|
47806
47838
|
}), e && _setPrototypeOf(t, e);
|
|
47807
47839
|
}
|
|
47808
47840
|
|
|
47809
|
-
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toPrimitive.js
|
|
47810
|
-
|
|
47811
|
-
function toPrimitive(t, r) {
|
|
47812
|
-
if ("object" != _typeof(t) || !t) return t;
|
|
47813
|
-
var e = t[Symbol.toPrimitive];
|
|
47814
|
-
if (void 0 !== e) {
|
|
47815
|
-
var i = e.call(t, r || "default");
|
|
47816
|
-
if ("object" != _typeof(i)) return i;
|
|
47817
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
47818
|
-
}
|
|
47819
|
-
return ("string" === r ? String : Number)(t);
|
|
47820
|
-
}
|
|
47821
|
-
|
|
47822
|
-
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
|
|
47823
|
-
|
|
47824
|
-
|
|
47825
|
-
function toPropertyKey(t) {
|
|
47826
|
-
var i = toPrimitive(t, "string");
|
|
47827
|
-
return "symbol" == _typeof(i) ? i : i + "";
|
|
47828
|
-
}
|
|
47829
|
-
|
|
47830
47841
|
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
|
47831
47842
|
|
|
47832
47843
|
function defineProperty_defineProperty(e, r, t) {
|
|
@@ -47840,14 +47851,12 @@ function defineProperty_defineProperty(e, r, t) {
|
|
|
47840
47851
|
|
|
47841
47852
|
;// CONCATENATED MODULE: ./node_modules/@box/react-virtualized/dist/es/Table/defaultCellRenderer.js
|
|
47842
47853
|
/*:: import type {CellRendererParams} from './types';*/
|
|
47843
|
-
|
|
47844
47854
|
/**
|
|
47845
47855
|
* Default cell renderer that displays an attribute as a simple string
|
|
47846
47856
|
* You should override the column's cellRenderer if your data is some other type of object.
|
|
47847
47857
|
*/
|
|
47848
|
-
function defaultCellRenderer(_ref) /*: string*/
|
|
47849
|
-
|
|
47850
|
-
var cellData = _ref.cellData;
|
|
47858
|
+
function defaultCellRenderer(_ref /*:: */) /*: string*/{
|
|
47859
|
+
var cellData = _ref /*:: */.cellData;
|
|
47851
47860
|
if (cellData == null) {
|
|
47852
47861
|
return '';
|
|
47853
47862
|
} else {
|
|
@@ -47856,15 +47865,14 @@ function defaultCellRenderer(_ref) /*: string*/
|
|
|
47856
47865
|
}
|
|
47857
47866
|
;// CONCATENATED MODULE: ./node_modules/@box/react-virtualized/dist/es/Table/defaultCellDataGetter.js
|
|
47858
47867
|
/*:: import type {CellDataGetterParams} from './types';*/
|
|
47859
|
-
|
|
47860
47868
|
/**
|
|
47861
47869
|
* Default accessor for returning a cell value for a given attribute.
|
|
47862
47870
|
* This function expects to operate on either a vanilla Object or an Immutable Map.
|
|
47863
47871
|
* You should override the column's cellDataGetter if your data is some other type of object.
|
|
47864
47872
|
*/
|
|
47865
|
-
function defaultCellDataGetter(_ref) {
|
|
47866
|
-
var dataKey = _ref
|
|
47867
|
-
rowData = _ref
|
|
47873
|
+
function defaultCellDataGetter(_ref /*:: */) {
|
|
47874
|
+
var dataKey = _ref /*:: */.dataKey,
|
|
47875
|
+
rowData = _ref /*:: */.rowData;
|
|
47868
47876
|
if (typeof rowData.get === 'function') {
|
|
47869
47877
|
return rowData.get(dataKey);
|
|
47870
47878
|
} else {
|
|
@@ -47878,6 +47886,19 @@ function defaultCellDataGetter(_ref) {
|
|
|
47878
47886
|
|
|
47879
47887
|
|
|
47880
47888
|
|
|
47889
|
+
function _callSuper(t, o, e) {
|
|
47890
|
+
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
|
47891
|
+
}
|
|
47892
|
+
function _isNativeReflectConstruct() {
|
|
47893
|
+
try {
|
|
47894
|
+
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
47895
|
+
} catch (t) {}
|
|
47896
|
+
return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {
|
|
47897
|
+
return !!t;
|
|
47898
|
+
})();
|
|
47899
|
+
}
|
|
47900
|
+
|
|
47901
|
+
|
|
47881
47902
|
|
|
47882
47903
|
|
|
47883
47904
|
|
|
@@ -47886,15 +47907,13 @@ function defaultCellDataGetter(_ref) {
|
|
|
47886
47907
|
/**
|
|
47887
47908
|
* Describes the header and cell contents of a table column.
|
|
47888
47909
|
*/
|
|
47889
|
-
|
|
47890
|
-
var Column = /*#__PURE__*/
|
|
47891
|
-
function (_React$Component) {
|
|
47892
|
-
_inherits(Column, _React$Component);
|
|
47910
|
+
var Column = /*#__PURE__*/function (_React$Component) {
|
|
47893
47911
|
function Column() {
|
|
47894
47912
|
_classCallCheck(this, Column);
|
|
47895
|
-
return
|
|
47913
|
+
return _callSuper(this, Column, arguments);
|
|
47896
47914
|
}
|
|
47897
|
-
|
|
47915
|
+
_inherits(Column, _React$Component);
|
|
47916
|
+
return _createClass(Column);
|
|
47898
47917
|
}(react.Component);
|
|
47899
47918
|
defineProperty_defineProperty(Column, "defaultProps", {
|
|
47900
47919
|
cellDataGetter: defaultCellDataGetter,
|
|
@@ -47909,25 +47928,10 @@ defineProperty_defineProperty(Column, "defaultProps", {
|
|
|
47909
47928
|
});
|
|
47910
47929
|
|
|
47911
47930
|
Column.propTypes = false ? 0 : {};
|
|
47912
|
-
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
|
|
47913
|
-
|
|
47914
|
-
function _defineProperties(e, r) {
|
|
47915
|
-
for (var t = 0; t < r.length; t++) {
|
|
47916
|
-
var o = r[t];
|
|
47917
|
-
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o);
|
|
47918
|
-
}
|
|
47919
|
-
}
|
|
47920
|
-
function _createClass(e, r, t) {
|
|
47921
|
-
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
47922
|
-
writable: !1
|
|
47923
|
-
}), e;
|
|
47924
|
-
}
|
|
47925
|
-
|
|
47926
47931
|
;// CONCATENATED MODULE: ./node_modules/@box/react-virtualized/dist/es/Grid/utils/calculateSizeAndPositionDataAndUpdateScrollOffset.js
|
|
47927
47932
|
/**
|
|
47928
47933
|
* Helper method that determines when to recalculate row or column metadata.
|
|
47929
47934
|
*/
|
|
47930
|
-
|
|
47931
47935
|
/*:: type Params<T> = {
|
|
47932
47936
|
// Number of rows or columns in the current axis
|
|
47933
47937
|
cellCount: number,
|
|
@@ -47956,23 +47960,23 @@ function _createClass(e, r, t) {
|
|
|
47956
47960
|
// Callback to invoke if the scroll position should be recalculated
|
|
47957
47961
|
updateScrollOffsetForScrollToIndex: () => void,
|
|
47958
47962
|
};*/
|
|
47959
|
-
function calculateSizeAndPositionDataAndUpdateScrollOffset(_ref) {
|
|
47960
|
-
var cellCount = _ref
|
|
47961
|
-
cellSize = _ref
|
|
47962
|
-
computeMetadataCallback = _ref
|
|
47963
|
-
computeMetadataCallbackProps = _ref
|
|
47964
|
-
nextCellsCount = _ref
|
|
47965
|
-
nextCellSize = _ref
|
|
47966
|
-
nextScrollToIndex = _ref
|
|
47967
|
-
scrollToIndex = _ref
|
|
47968
|
-
updateScrollOffsetForScrollToIndex = _ref
|
|
47969
|
-
|
|
47963
|
+
function calculateSizeAndPositionDataAndUpdateScrollOffset(_ref /*:: */) {
|
|
47964
|
+
var cellCount = _ref /*:: */.cellCount,
|
|
47965
|
+
cellSize = _ref /*:: */.cellSize,
|
|
47966
|
+
computeMetadataCallback = _ref /*:: */.computeMetadataCallback,
|
|
47967
|
+
computeMetadataCallbackProps = _ref /*:: */.computeMetadataCallbackProps,
|
|
47968
|
+
nextCellsCount = _ref /*:: */.nextCellsCount,
|
|
47969
|
+
nextCellSize = _ref /*:: */.nextCellSize,
|
|
47970
|
+
nextScrollToIndex = _ref /*:: */.nextScrollToIndex,
|
|
47971
|
+
scrollToIndex = _ref /*:: */.scrollToIndex,
|
|
47972
|
+
updateScrollOffsetForScrollToIndex = _ref /*:: */.updateScrollOffsetForScrollToIndex;
|
|
47970
47973
|
// Don't compare cell sizes if they are functions because inline functions would cause infinite loops.
|
|
47971
47974
|
// In that event users should use the manual recompute methods to inform of changes.
|
|
47972
47975
|
if (cellCount !== nextCellsCount || (typeof cellSize === 'number' || typeof nextCellSize === 'number') && cellSize !== nextCellSize) {
|
|
47973
|
-
computeMetadataCallback(computeMetadataCallbackProps);
|
|
47974
|
-
// In this case we should also update the scrollTop to ensure it stays visible.
|
|
47976
|
+
computeMetadataCallback(computeMetadataCallbackProps);
|
|
47975
47977
|
|
|
47978
|
+
// Updated cell metadata may have hidden the previous scrolled-to item.
|
|
47979
|
+
// In this case we should also update the scrollTop to ensure it stays visible.
|
|
47976
47980
|
if (scrollToIndex >= 0 && scrollToIndex === nextScrollToIndex) {
|
|
47977
47981
|
updateScrollOffsetForScrollToIndex();
|
|
47978
47982
|
}
|
|
@@ -47996,54 +48000,46 @@ function objectWithoutProperties_objectWithoutProperties(e, t) {
|
|
|
47996
48000
|
|
|
47997
48001
|
|
|
47998
48002
|
|
|
47999
|
-
|
|
48000
48003
|
/*:: import type {Alignment, CellSizeGetter, VisibleCellRange} from '../types';*/
|
|
48001
|
-
|
|
48002
48004
|
/*:: type CellSizeAndPositionManagerParams = {
|
|
48003
48005
|
cellCount: number,
|
|
48004
48006
|
cellSizeGetter: CellSizeGetter,
|
|
48005
48007
|
estimatedCellSize: number,
|
|
48006
48008
|
};*/
|
|
48007
|
-
|
|
48008
48009
|
/*:: type ConfigureParams = {
|
|
48009
48010
|
cellCount: number,
|
|
48010
48011
|
estimatedCellSize: number,
|
|
48011
48012
|
cellSizeGetter: CellSizeGetter,
|
|
48012
48013
|
};*/
|
|
48013
|
-
|
|
48014
48014
|
/*:: type GetUpdatedOffsetForIndex = {
|
|
48015
48015
|
align: Alignment,
|
|
48016
48016
|
containerSize: number,
|
|
48017
48017
|
currentOffset: number,
|
|
48018
48018
|
targetIndex: number,
|
|
48019
48019
|
};*/
|
|
48020
|
-
|
|
48021
48020
|
/*:: type GetVisibleCellRangeParams = {
|
|
48022
48021
|
containerSize: number,
|
|
48023
48022
|
offset: number,
|
|
48024
48023
|
};*/
|
|
48025
|
-
|
|
48026
48024
|
/*:: type SizeAndPositionData = {
|
|
48027
48025
|
offset: number,
|
|
48028
48026
|
size: number,
|
|
48029
48027
|
};*/
|
|
48030
|
-
|
|
48031
48028
|
/**
|
|
48032
48029
|
* Just-in-time calculates and caches size and position information for a collection of cells.
|
|
48033
48030
|
*/
|
|
48034
|
-
var CellSizeAndPositionManager = /*#__PURE__*/
|
|
48035
|
-
function () {
|
|
48036
|
-
|
|
48037
|
-
|
|
48038
|
-
|
|
48039
|
-
// Used in deferred mode to track which cells have been queued for measurement.
|
|
48040
|
-
function CellSizeAndPositionManager(_ref) {
|
|
48041
|
-
var cellCount = _ref.cellCount,
|
|
48042
|
-
cellSizeGetter = _ref.cellSizeGetter,
|
|
48043
|
-
estimatedCellSize = _ref.estimatedCellSize;
|
|
48031
|
+
var CellSizeAndPositionManager = /*#__PURE__*/function () {
|
|
48032
|
+
function CellSizeAndPositionManager(_ref /*:: */) {
|
|
48033
|
+
var cellCount = _ref /*:: */.cellCount,
|
|
48034
|
+
cellSizeGetter = _ref /*:: */.cellSizeGetter,
|
|
48035
|
+
estimatedCellSize = _ref /*:: */.estimatedCellSize;
|
|
48044
48036
|
_classCallCheck(this, CellSizeAndPositionManager);
|
|
48037
|
+
// Cache of size and position data for cells, mapped by cell index.
|
|
48038
|
+
// Note that invalid values may exist in this map so only rely on cells up to this._lastMeasuredIndex
|
|
48045
48039
|
defineProperty_defineProperty(this, "_cellSizeAndPositionData", {});
|
|
48040
|
+
// Measurements for cells up to this index can be trusted; cells afterward should be estimated.
|
|
48046
48041
|
defineProperty_defineProperty(this, "_lastMeasuredIndex", -1);
|
|
48042
|
+
// Used in deferred mode to track which cells have been queued for measurement.
|
|
48047
48043
|
defineProperty_defineProperty(this, "_lastBatchedIndex", -1);
|
|
48048
48044
|
defineProperty_defineProperty(this, "_cellCount", void 0);
|
|
48049
48045
|
defineProperty_defineProperty(this, "_cellSizeGetter", void 0);
|
|
@@ -48052,37 +48048,34 @@ function () {
|
|
|
48052
48048
|
this._cellCount = cellCount;
|
|
48053
48049
|
this._estimatedCellSize = estimatedCellSize;
|
|
48054
48050
|
}
|
|
48055
|
-
_createClass(CellSizeAndPositionManager, [{
|
|
48051
|
+
return _createClass(CellSizeAndPositionManager, [{
|
|
48056
48052
|
key: "areOffsetsAdjusted",
|
|
48057
48053
|
value: function areOffsetsAdjusted() {
|
|
48058
48054
|
return false;
|
|
48059
48055
|
}
|
|
48060
48056
|
}, {
|
|
48061
48057
|
key: "configure",
|
|
48062
|
-
value: function configure(_ref2) {
|
|
48063
|
-
var cellCount = _ref2
|
|
48064
|
-
estimatedCellSize = _ref2
|
|
48065
|
-
cellSizeGetter = _ref2
|
|
48058
|
+
value: function configure(_ref2 /*:: */) {
|
|
48059
|
+
var cellCount = _ref2 /*:: */.cellCount,
|
|
48060
|
+
estimatedCellSize = _ref2 /*:: */.estimatedCellSize,
|
|
48061
|
+
cellSizeGetter = _ref2 /*:: */.cellSizeGetter;
|
|
48066
48062
|
this._cellCount = cellCount;
|
|
48067
48063
|
this._estimatedCellSize = estimatedCellSize;
|
|
48068
48064
|
this._cellSizeGetter = cellSizeGetter;
|
|
48069
48065
|
}
|
|
48070
48066
|
}, {
|
|
48071
48067
|
key: "getCellCount",
|
|
48072
|
-
value: function getCellCount() /*: number*/
|
|
48073
|
-
{
|
|
48068
|
+
value: function getCellCount() /*: number*/{
|
|
48074
48069
|
return this._cellCount;
|
|
48075
48070
|
}
|
|
48076
48071
|
}, {
|
|
48077
48072
|
key: "getEstimatedCellSize",
|
|
48078
|
-
value: function getEstimatedCellSize() /*: number*/
|
|
48079
|
-
{
|
|
48073
|
+
value: function getEstimatedCellSize() /*: number*/{
|
|
48080
48074
|
return this._estimatedCellSize;
|
|
48081
48075
|
}
|
|
48082
48076
|
}, {
|
|
48083
48077
|
key: "getLastMeasuredIndex",
|
|
48084
|
-
value: function getLastMeasuredIndex() /*: number*/
|
|
48085
|
-
{
|
|
48078
|
+
value: function getLastMeasuredIndex() /*: number*/{
|
|
48086
48079
|
return this._lastMeasuredIndex;
|
|
48087
48080
|
}
|
|
48088
48081
|
}, {
|
|
@@ -48090,15 +48083,14 @@ function () {
|
|
|
48090
48083
|
value: function getOffsetAdjustment() {
|
|
48091
48084
|
return 0;
|
|
48092
48085
|
}
|
|
48086
|
+
|
|
48093
48087
|
/**
|
|
48094
48088
|
* This method returns the size and position for the cell at the specified index.
|
|
48095
48089
|
* It just-in-time calculates (or used cached values) for cells leading up to the index.
|
|
48096
48090
|
*/
|
|
48097
48091
|
}, {
|
|
48098
48092
|
key: "getSizeAndPositionOfCell",
|
|
48099
|
-
value: function getSizeAndPositionOfCell(index
|
|
48100
|
-
/*: number*/) /*: SizeAndPositionData*/
|
|
48101
|
-
{
|
|
48093
|
+
value: function getSizeAndPositionOfCell(index /*: number*/) /*: SizeAndPositionData*/{
|
|
48102
48094
|
if (index < 0 || index >= this._cellCount) {
|
|
48103
48095
|
throw Error("Requested index ".concat(index, " is outside of range 0..").concat(this._cellCount));
|
|
48104
48096
|
}
|
|
@@ -48108,9 +48100,10 @@ function () {
|
|
|
48108
48100
|
for (var i = this._lastMeasuredIndex + 1; i <= index; i++) {
|
|
48109
48101
|
var size = this._cellSizeGetter({
|
|
48110
48102
|
index: i
|
|
48111
|
-
});
|
|
48112
|
-
// null means we're using CellMeasurer and haven't yet measured a given index.
|
|
48103
|
+
});
|
|
48113
48104
|
|
|
48105
|
+
// undefined or NaN probably means a logic error in the size getter.
|
|
48106
|
+
// null means we're using CellMeasurer and haven't yet measured a given index.
|
|
48114
48107
|
if (size === undefined || isNaN(size)) {
|
|
48115
48108
|
throw Error("Invalid size returned for cell ".concat(i, " of value ").concat(size));
|
|
48116
48109
|
} else if (size === null) {
|
|
@@ -48133,13 +48126,13 @@ function () {
|
|
|
48133
48126
|
}
|
|
48134
48127
|
}, {
|
|
48135
48128
|
key: "getSizeAndPositionOfLastMeasuredCell",
|
|
48136
|
-
value: function getSizeAndPositionOfLastMeasuredCell() /*: SizeAndPositionData*/
|
|
48137
|
-
{
|
|
48129
|
+
value: function getSizeAndPositionOfLastMeasuredCell() /*: SizeAndPositionData*/{
|
|
48138
48130
|
return this._lastMeasuredIndex >= 0 ? this._cellSizeAndPositionData[this._lastMeasuredIndex] : {
|
|
48139
48131
|
offset: 0,
|
|
48140
48132
|
size: 0
|
|
48141
48133
|
};
|
|
48142
48134
|
}
|
|
48135
|
+
|
|
48143
48136
|
/**
|
|
48144
48137
|
* Total size of all cells being measured.
|
|
48145
48138
|
* This value will be completely estimated initially.
|
|
@@ -48147,14 +48140,14 @@ function () {
|
|
|
48147
48140
|
*/
|
|
48148
48141
|
}, {
|
|
48149
48142
|
key: "getTotalSize",
|
|
48150
|
-
value: function getTotalSize() /*: number*/
|
|
48151
|
-
{
|
|
48143
|
+
value: function getTotalSize() /*: number*/{
|
|
48152
48144
|
var lastMeasuredCellSizeAndPosition = this.getSizeAndPositionOfLastMeasuredCell();
|
|
48153
48145
|
var totalSizeOfMeasuredCells = lastMeasuredCellSizeAndPosition.offset + lastMeasuredCellSizeAndPosition.size;
|
|
48154
48146
|
var numUnmeasuredCells = this._cellCount - this._lastMeasuredIndex - 1;
|
|
48155
48147
|
var totalSizeOfUnmeasuredCells = numUnmeasuredCells * this._estimatedCellSize;
|
|
48156
48148
|
return totalSizeOfMeasuredCells + totalSizeOfUnmeasuredCells;
|
|
48157
48149
|
}
|
|
48150
|
+
|
|
48158
48151
|
/**
|
|
48159
48152
|
* Determines a new offset that ensures a certain cell is visible, given the current offset.
|
|
48160
48153
|
* If the cell is already visible then the current offset will be returned.
|
|
@@ -48168,13 +48161,12 @@ function () {
|
|
|
48168
48161
|
*/
|
|
48169
48162
|
}, {
|
|
48170
48163
|
key: "getUpdatedOffsetForIndex",
|
|
48171
|
-
value: function getUpdatedOffsetForIndex(_ref3) /*: number*/
|
|
48172
|
-
|
|
48173
|
-
var _ref3$align = _ref3.align,
|
|
48164
|
+
value: function getUpdatedOffsetForIndex(_ref3 /*:: */) /*: number*/{
|
|
48165
|
+
var _ref3$align = _ref3 /*:: */.align,
|
|
48174
48166
|
align = _ref3$align === void 0 ? 'auto' : _ref3$align,
|
|
48175
|
-
containerSize = _ref3
|
|
48176
|
-
currentOffset = _ref3
|
|
48177
|
-
targetIndex = _ref3
|
|
48167
|
+
containerSize = _ref3 /*:: */.containerSize,
|
|
48168
|
+
currentOffset = _ref3 /*:: */.currentOffset,
|
|
48169
|
+
targetIndex = _ref3 /*:: */.targetIndex;
|
|
48178
48170
|
if (containerSize <= 0) {
|
|
48179
48171
|
return 0;
|
|
48180
48172
|
}
|
|
@@ -48201,9 +48193,7 @@ function () {
|
|
|
48201
48193
|
}
|
|
48202
48194
|
}, {
|
|
48203
48195
|
key: "getVisibleCellRange",
|
|
48204
|
-
value: function getVisibleCellRange(params
|
|
48205
|
-
/*: GetVisibleCellRangeParams*/) /*: VisibleCellRange*/
|
|
48206
|
-
{
|
|
48196
|
+
value: function getVisibleCellRange(params /*: GetVisibleCellRangeParams*/) /*: VisibleCellRange*/{
|
|
48207
48197
|
var containerSize = params.containerSize,
|
|
48208
48198
|
offset = params.offset;
|
|
48209
48199
|
var totalSize = this.getTotalSize();
|
|
@@ -48224,6 +48214,7 @@ function () {
|
|
|
48224
48214
|
stop: stop
|
|
48225
48215
|
};
|
|
48226
48216
|
}
|
|
48217
|
+
|
|
48227
48218
|
/**
|
|
48228
48219
|
* Clear all cached values for cells after the specified index.
|
|
48229
48220
|
* This method should be called for any cell that has changed its size.
|
|
@@ -48231,18 +48222,12 @@ function () {
|
|
|
48231
48222
|
*/
|
|
48232
48223
|
}, {
|
|
48233
48224
|
key: "resetCell",
|
|
48234
|
-
value: function resetCell(index
|
|
48235
|
-
/*: number*/) /*: void*/
|
|
48236
|
-
{
|
|
48225
|
+
value: function resetCell(index /*: number*/) /*: void*/{
|
|
48237
48226
|
this._lastMeasuredIndex = Math.min(this._lastMeasuredIndex, index - 1);
|
|
48238
48227
|
}
|
|
48239
48228
|
}, {
|
|
48240
48229
|
key: "_binarySearch",
|
|
48241
|
-
value: function _binarySearch(high
|
|
48242
|
-
/*: number*/, low
|
|
48243
|
-
/*: number*/, offset
|
|
48244
|
-
/*: number*/) /*: number*/
|
|
48245
|
-
{
|
|
48230
|
+
value: function _binarySearch(high /*: number*/, low /*: number*/, offset /*: number*/) /*: number*/{
|
|
48246
48231
|
while (low <= high) {
|
|
48247
48232
|
var middle = low + Math.floor((high - low) / 2);
|
|
48248
48233
|
var currentOffset = this.getSizeAndPositionOfCell(middle).offset;
|
|
@@ -48262,10 +48247,7 @@ function () {
|
|
|
48262
48247
|
}
|
|
48263
48248
|
}, {
|
|
48264
48249
|
key: "_exponentialSearch",
|
|
48265
|
-
value: function _exponentialSearch(index
|
|
48266
|
-
/*: number*/, offset
|
|
48267
|
-
/*: number*/) /*: number*/
|
|
48268
|
-
{
|
|
48250
|
+
value: function _exponentialSearch(index /*: number*/, offset /*: number*/) /*: number*/{
|
|
48269
48251
|
var interval = 1;
|
|
48270
48252
|
while (index < this._cellCount && this.getSizeAndPositionOfCell(index).offset < offset) {
|
|
48271
48253
|
index += interval;
|
|
@@ -48273,6 +48255,7 @@ function () {
|
|
|
48273
48255
|
}
|
|
48274
48256
|
return this._binarySearch(Math.min(index, this._cellCount - 1), Math.floor(index / 2), offset);
|
|
48275
48257
|
}
|
|
48258
|
+
|
|
48276
48259
|
/**
|
|
48277
48260
|
* Searches for the cell (index) nearest the specified offset.
|
|
48278
48261
|
*
|
|
@@ -48281,14 +48264,13 @@ function () {
|
|
|
48281
48264
|
*/
|
|
48282
48265
|
}, {
|
|
48283
48266
|
key: "_findNearestCell",
|
|
48284
|
-
value: function _findNearestCell(offset
|
|
48285
|
-
/*: number*/) /*: number*/
|
|
48286
|
-
{
|
|
48267
|
+
value: function _findNearestCell(offset /*: number*/) /*: number*/{
|
|
48287
48268
|
if (isNaN(offset)) {
|
|
48288
48269
|
throw Error("Invalid offset ".concat(offset, " specified"));
|
|
48289
|
-
}
|
|
48290
|
-
// So make sure the offset is at least 0 or no match will be found.
|
|
48270
|
+
}
|
|
48291
48271
|
|
|
48272
|
+
// Our search algorithms find the nearest match at or below the specified offset.
|
|
48273
|
+
// So make sure the offset is at least 0 or no match will be found.
|
|
48292
48274
|
offset = Math.max(0, offset);
|
|
48293
48275
|
var lastMeasuredCellSizeAndPosition = this.getSizeAndPositionOfLastMeasuredCell();
|
|
48294
48276
|
var lastMeasuredIndex = Math.max(0, this._lastMeasuredIndex);
|
|
@@ -48303,7 +48285,6 @@ function () {
|
|
|
48303
48285
|
}
|
|
48304
48286
|
}
|
|
48305
48287
|
}]);
|
|
48306
|
-
return CellSizeAndPositionManager;
|
|
48307
48288
|
}();
|
|
48308
48289
|
|
|
48309
48290
|
;// CONCATENATED MODULE: ./node_modules/@box/react-virtualized/dist/es/Grid/utils/maxElementSize.js
|
|
@@ -48315,8 +48296,7 @@ var maxElementSize_isBrowser = function isBrowser() {
|
|
|
48315
48296
|
var isChrome = function isChrome() {
|
|
48316
48297
|
return !!window.chrome;
|
|
48317
48298
|
};
|
|
48318
|
-
var getMaxElementSize = function getMaxElementSize() /*: number*/
|
|
48319
|
-
{
|
|
48299
|
+
var getMaxElementSize = function getMaxElementSize() /*: number*/{
|
|
48320
48300
|
if (maxElementSize_isBrowser()) {
|
|
48321
48301
|
if (isChrome()) {
|
|
48322
48302
|
return CHROME_MAX_ELEMENT_SIZE;
|
|
@@ -48329,7 +48309,7 @@ var getMaxElementSize = function getMaxElementSize() /*: number*/
|
|
|
48329
48309
|
|
|
48330
48310
|
|
|
48331
48311
|
|
|
48332
|
-
|
|
48312
|
+
var ScalingCellSizeAndPositionManager_excluded = ["maxScrollSize"];
|
|
48333
48313
|
/*:: import type {Alignment, CellSizeGetter, VisibleCellRange} from '../types';*/
|
|
48334
48314
|
|
|
48335
48315
|
|
|
@@ -48337,35 +48317,35 @@ var getMaxElementSize = function getMaxElementSize() /*: number*/
|
|
|
48337
48317
|
containerSize: number,
|
|
48338
48318
|
offset: number,
|
|
48339
48319
|
};*/
|
|
48340
|
-
|
|
48341
48320
|
/*:: type Params = {
|
|
48342
48321
|
maxScrollSize?: number,
|
|
48343
48322
|
cellCount: number,
|
|
48344
48323
|
cellSizeGetter: CellSizeGetter,
|
|
48345
48324
|
estimatedCellSize: number,
|
|
48346
48325
|
};*/
|
|
48347
|
-
|
|
48326
|
+
/**
|
|
48327
|
+
* Browsers have scroll offset limitations (eg Chrome stops scrolling at ~33.5M pixels where as Edge tops out at ~1.5M pixels).
|
|
48328
|
+
* After a certain position, the browser won't allow the user to scroll further (even via JavaScript scroll offset adjustments).
|
|
48329
|
+
* This util picks a lower ceiling for max size and artificially adjusts positions within to make it transparent for users.
|
|
48330
|
+
*/
|
|
48348
48331
|
/**
|
|
48349
48332
|
* Extends CellSizeAndPositionManager and adds scaling behavior for lists that are too large to fit within a browser's native limits.
|
|
48350
48333
|
*/
|
|
48351
|
-
var ScalingCellSizeAndPositionManager = /*#__PURE__*/
|
|
48352
|
-
function () {
|
|
48353
|
-
|
|
48354
|
-
var _ref$maxScrollSize = _ref.maxScrollSize,
|
|
48334
|
+
var ScalingCellSizeAndPositionManager = /*#__PURE__*/function () {
|
|
48335
|
+
function ScalingCellSizeAndPositionManager(_ref /*:: */) {
|
|
48336
|
+
var _ref$maxScrollSize = _ref /*:: */.maxScrollSize,
|
|
48355
48337
|
maxScrollSize = _ref$maxScrollSize === void 0 ? getMaxElementSize() : _ref$maxScrollSize,
|
|
48356
|
-
params = objectWithoutProperties_objectWithoutProperties(_ref
|
|
48338
|
+
params = objectWithoutProperties_objectWithoutProperties(_ref /*:: */, ScalingCellSizeAndPositionManager_excluded);
|
|
48357
48339
|
_classCallCheck(this, ScalingCellSizeAndPositionManager);
|
|
48358
48340
|
defineProperty_defineProperty(this, "_cellSizeAndPositionManager", void 0);
|
|
48359
48341
|
defineProperty_defineProperty(this, "_maxScrollSize", void 0);
|
|
48360
|
-
|
|
48361
48342
|
// Favor composition over inheritance to simplify IE10 support
|
|
48362
48343
|
this._cellSizeAndPositionManager = new CellSizeAndPositionManager(params);
|
|
48363
48344
|
this._maxScrollSize = maxScrollSize;
|
|
48364
48345
|
}
|
|
48365
|
-
_createClass(ScalingCellSizeAndPositionManager, [{
|
|
48346
|
+
return _createClass(ScalingCellSizeAndPositionManager, [{
|
|
48366
48347
|
key: "areOffsetsAdjusted",
|
|
48367
|
-
value: function areOffsetsAdjusted() /*: boolean*/
|
|
48368
|
-
{
|
|
48348
|
+
value: function areOffsetsAdjusted() /*: boolean*/{
|
|
48369
48349
|
return this._cellSizeAndPositionManager.getTotalSize() > this._maxScrollSize;
|
|
48370
48350
|
}
|
|
48371
48351
|
}, {
|
|
@@ -48380,32 +48360,29 @@ function () {
|
|
|
48380
48360
|
}
|
|
48381
48361
|
}, {
|
|
48382
48362
|
key: "getCellCount",
|
|
48383
|
-
value: function getCellCount() /*: number*/
|
|
48384
|
-
{
|
|
48363
|
+
value: function getCellCount() /*: number*/{
|
|
48385
48364
|
return this._cellSizeAndPositionManager.getCellCount();
|
|
48386
48365
|
}
|
|
48387
48366
|
}, {
|
|
48388
48367
|
key: "getEstimatedCellSize",
|
|
48389
|
-
value: function getEstimatedCellSize() /*: number*/
|
|
48390
|
-
{
|
|
48368
|
+
value: function getEstimatedCellSize() /*: number*/{
|
|
48391
48369
|
return this._cellSizeAndPositionManager.getEstimatedCellSize();
|
|
48392
48370
|
}
|
|
48393
48371
|
}, {
|
|
48394
48372
|
key: "getLastMeasuredIndex",
|
|
48395
|
-
value: function getLastMeasuredIndex() /*: number*/
|
|
48396
|
-
{
|
|
48373
|
+
value: function getLastMeasuredIndex() /*: number*/{
|
|
48397
48374
|
return this._cellSizeAndPositionManager.getLastMeasuredIndex();
|
|
48398
48375
|
}
|
|
48376
|
+
|
|
48399
48377
|
/**
|
|
48400
48378
|
* Number of pixels a cell at the given position (offset) should be shifted in order to fit within the scaled container.
|
|
48401
48379
|
* The offset passed to this function is scaled (safe) as well.
|
|
48402
48380
|
*/
|
|
48403
48381
|
}, {
|
|
48404
48382
|
key: "getOffsetAdjustment",
|
|
48405
|
-
value: function getOffsetAdjustment(_ref2) /*: number*/
|
|
48406
|
-
|
|
48407
|
-
|
|
48408
|
-
offset = _ref2.offset;
|
|
48383
|
+
value: function getOffsetAdjustment(_ref2 /*:: */) /*: number*/{
|
|
48384
|
+
var containerSize = _ref2 /*:: */.containerSize,
|
|
48385
|
+
offset = _ref2 /*:: */.offset;
|
|
48409
48386
|
var totalSize = this._cellSizeAndPositionManager.getTotalSize();
|
|
48410
48387
|
var safeTotalSize = this.getTotalSize();
|
|
48411
48388
|
var offsetPercentage = this._getOffsetPercentage({
|
|
@@ -48417,8 +48394,7 @@ function () {
|
|
|
48417
48394
|
}
|
|
48418
48395
|
}, {
|
|
48419
48396
|
key: "getSizeAndPositionOfCell",
|
|
48420
|
-
value: function getSizeAndPositionOfCell(index
|
|
48421
|
-
/*: number*/) {
|
|
48397
|
+
value: function getSizeAndPositionOfCell(index /*: number*/) {
|
|
48422
48398
|
return this._cellSizeAndPositionManager.getSizeAndPositionOfCell(index);
|
|
48423
48399
|
}
|
|
48424
48400
|
}, {
|
|
@@ -48426,22 +48402,23 @@ function () {
|
|
|
48426
48402
|
value: function getSizeAndPositionOfLastMeasuredCell() {
|
|
48427
48403
|
return this._cellSizeAndPositionManager.getSizeAndPositionOfLastMeasuredCell();
|
|
48428
48404
|
}
|
|
48405
|
+
|
|
48429
48406
|
/** See CellSizeAndPositionManager#getTotalSize */
|
|
48430
48407
|
}, {
|
|
48431
48408
|
key: "getTotalSize",
|
|
48432
|
-
value: function getTotalSize() /*: number*/
|
|
48433
|
-
{
|
|
48409
|
+
value: function getTotalSize() /*: number*/{
|
|
48434
48410
|
return Math.min(this._maxScrollSize, this._cellSizeAndPositionManager.getTotalSize());
|
|
48435
48411
|
}
|
|
48412
|
+
|
|
48436
48413
|
/** See CellSizeAndPositionManager#getUpdatedOffsetForIndex */
|
|
48437
48414
|
}, {
|
|
48438
48415
|
key: "getUpdatedOffsetForIndex",
|
|
48439
|
-
value: function getUpdatedOffsetForIndex(_ref3) {
|
|
48440
|
-
var _ref3$align = _ref3
|
|
48416
|
+
value: function getUpdatedOffsetForIndex(_ref3 /*:: */) {
|
|
48417
|
+
var _ref3$align = _ref3 /*:: */.align,
|
|
48441
48418
|
align = _ref3$align === void 0 ? 'auto' : _ref3$align,
|
|
48442
|
-
containerSize = _ref3
|
|
48443
|
-
currentOffset = _ref3
|
|
48444
|
-
targetIndex = _ref3
|
|
48419
|
+
containerSize = _ref3 /*:: */.containerSize,
|
|
48420
|
+
currentOffset = _ref3 /*:: */.currentOffset,
|
|
48421
|
+
targetIndex = _ref3 /*:: */.targetIndex;
|
|
48445
48422
|
currentOffset = this._safeOffsetToOffset({
|
|
48446
48423
|
containerSize: containerSize,
|
|
48447
48424
|
offset: currentOffset
|
|
@@ -48457,13 +48434,13 @@ function () {
|
|
|
48457
48434
|
offset: offset
|
|
48458
48435
|
});
|
|
48459
48436
|
}
|
|
48437
|
+
|
|
48460
48438
|
/** See CellSizeAndPositionManager#getVisibleCellRange */
|
|
48461
48439
|
}, {
|
|
48462
48440
|
key: "getVisibleCellRange",
|
|
48463
|
-
value: function getVisibleCellRange(_ref4) /*: VisibleCellRange*/
|
|
48464
|
-
|
|
48465
|
-
|
|
48466
|
-
offset = _ref4.offset;
|
|
48441
|
+
value: function getVisibleCellRange(_ref4 /*:: */) /*: VisibleCellRange*/{
|
|
48442
|
+
var containerSize = _ref4 /*:: */.containerSize,
|
|
48443
|
+
offset = _ref4 /*:: */.offset;
|
|
48467
48444
|
offset = this._safeOffsetToOffset({
|
|
48468
48445
|
containerSize: containerSize,
|
|
48469
48446
|
offset: offset
|
|
@@ -48475,25 +48452,22 @@ function () {
|
|
|
48475
48452
|
}
|
|
48476
48453
|
}, {
|
|
48477
48454
|
key: "resetCell",
|
|
48478
|
-
value: function resetCell(index
|
|
48479
|
-
/*: number*/) /*: void*/
|
|
48480
|
-
{
|
|
48455
|
+
value: function resetCell(index /*: number*/) /*: void*/{
|
|
48481
48456
|
this._cellSizeAndPositionManager.resetCell(index);
|
|
48482
48457
|
}
|
|
48483
48458
|
}, {
|
|
48484
48459
|
key: "_getOffsetPercentage",
|
|
48485
|
-
value: function _getOffsetPercentage(_ref5) {
|
|
48486
|
-
var containerSize = _ref5
|
|
48487
|
-
offset = _ref5
|
|
48488
|
-
totalSize = _ref5
|
|
48460
|
+
value: function _getOffsetPercentage(_ref5 /*:: */) {
|
|
48461
|
+
var containerSize = _ref5 /*:: */.containerSize,
|
|
48462
|
+
offset = _ref5 /*:: */.offset,
|
|
48463
|
+
totalSize = _ref5 /*:: */.totalSize;
|
|
48489
48464
|
return totalSize <= containerSize ? 0 : offset / (totalSize - containerSize);
|
|
48490
48465
|
}
|
|
48491
48466
|
}, {
|
|
48492
48467
|
key: "_offsetToSafeOffset",
|
|
48493
|
-
value: function _offsetToSafeOffset(_ref6) /*: number*/
|
|
48494
|
-
|
|
48495
|
-
|
|
48496
|
-
offset = _ref6.offset;
|
|
48468
|
+
value: function _offsetToSafeOffset(_ref6 /*:: */) /*: number*/{
|
|
48469
|
+
var containerSize = _ref6 /*:: */.containerSize,
|
|
48470
|
+
offset = _ref6 /*:: */.offset;
|
|
48497
48471
|
var totalSize = this._cellSizeAndPositionManager.getTotalSize();
|
|
48498
48472
|
var safeTotalSize = this.getTotalSize();
|
|
48499
48473
|
if (totalSize === safeTotalSize) {
|
|
@@ -48509,10 +48483,9 @@ function () {
|
|
|
48509
48483
|
}
|
|
48510
48484
|
}, {
|
|
48511
48485
|
key: "_safeOffsetToOffset",
|
|
48512
|
-
value: function _safeOffsetToOffset(_ref7) /*: number*/
|
|
48513
|
-
|
|
48514
|
-
|
|
48515
|
-
offset = _ref7.offset;
|
|
48486
|
+
value: function _safeOffsetToOffset(_ref7 /*:: */) /*: number*/{
|
|
48487
|
+
var containerSize = _ref7 /*:: */.containerSize,
|
|
48488
|
+
offset = _ref7 /*:: */.offset;
|
|
48516
48489
|
var totalSize = this._cellSizeAndPositionManager.getTotalSize();
|
|
48517
48490
|
var safeTotalSize = this.getTotalSize();
|
|
48518
48491
|
if (totalSize === safeTotalSize) {
|
|
@@ -48527,7 +48500,6 @@ function () {
|
|
|
48527
48500
|
}
|
|
48528
48501
|
}
|
|
48529
48502
|
}]);
|
|
48530
|
-
return ScalingCellSizeAndPositionManager;
|
|
48531
48503
|
}();
|
|
48532
48504
|
|
|
48533
48505
|
;// CONCATENATED MODULE: ./node_modules/@box/react-virtualized/dist/es/utils/createCallbackMemoizer.js
|
|
@@ -48562,18 +48534,18 @@ var SCROLL_DIRECTION_BACKWARD = -1;
|
|
|
48562
48534
|
var SCROLL_DIRECTION_FORWARD = 1;
|
|
48563
48535
|
var SCROLL_DIRECTION_HORIZONTAL = 'horizontal';
|
|
48564
48536
|
var SCROLL_DIRECTION_VERTICAL = 'vertical';
|
|
48537
|
+
|
|
48565
48538
|
/**
|
|
48566
48539
|
* Calculates the number of cells to overscan before and after a specified range.
|
|
48567
48540
|
* This function ensures that overscanning doesn't exceed the available cells.
|
|
48568
48541
|
*/
|
|
48569
48542
|
|
|
48570
|
-
function defaultOverscanIndicesGetter(_ref) /*: OverscanIndices*/
|
|
48571
|
-
|
|
48572
|
-
|
|
48573
|
-
|
|
48574
|
-
|
|
48575
|
-
|
|
48576
|
-
stopIndex = _ref.stopIndex;
|
|
48543
|
+
function defaultOverscanIndicesGetter(_ref /*:: */) /*: OverscanIndices*/{
|
|
48544
|
+
var cellCount = _ref /*:: */.cellCount,
|
|
48545
|
+
overscanCellsCount = _ref /*:: */.overscanCellsCount,
|
|
48546
|
+
scrollDirection = _ref /*:: */.scrollDirection,
|
|
48547
|
+
startIndex = _ref /*:: */.startIndex,
|
|
48548
|
+
stopIndex = _ref /*:: */.stopIndex;
|
|
48577
48549
|
if (scrollDirection === SCROLL_DIRECTION_FORWARD) {
|
|
48578
48550
|
return {
|
|
48579
48551
|
overscanStartIndex: Math.max(0, startIndex),
|
|
@@ -48589,11 +48561,11 @@ function defaultOverscanIndicesGetter(_ref) /*: OverscanIndices*/
|
|
|
48589
48561
|
;// CONCATENATED MODULE: ./node_modules/@box/react-virtualized/dist/es/Grid/utils/updateScrollIndexHelper.js
|
|
48590
48562
|
/*:: import type {Alignment, CellSize} from '../types';*/
|
|
48591
48563
|
|
|
48564
|
+
|
|
48592
48565
|
/**
|
|
48593
48566
|
* Helper function that determines when to update scroll offsets to ensure that a scroll-to-index remains visible.
|
|
48594
48567
|
* This function also ensures that the scroll ofset isn't past the last column/row of cells.
|
|
48595
48568
|
*/
|
|
48596
|
-
|
|
48597
48569
|
/*:: type Params = {
|
|
48598
48570
|
// Width or height of cells for the current axis
|
|
48599
48571
|
cellSize?: CellSize,
|
|
@@ -48631,28 +48603,30 @@ function defaultOverscanIndicesGetter(_ref) /*: OverscanIndices*/
|
|
|
48631
48603
|
// Callback to invoke with an scroll-to-index value
|
|
48632
48604
|
updateScrollIndexCallback: (index: number) => void,
|
|
48633
48605
|
};*/
|
|
48634
|
-
|
|
48635
|
-
|
|
48636
|
-
|
|
48637
|
-
|
|
48638
|
-
|
|
48639
|
-
|
|
48640
|
-
|
|
48641
|
-
|
|
48642
|
-
|
|
48643
|
-
|
|
48644
|
-
|
|
48645
|
-
|
|
48646
|
-
|
|
48647
|
-
|
|
48648
|
-
updateScrollIndexCallback = _ref.updateScrollIndexCallback;
|
|
48606
|
+
function updateScrollIndexHelper(_ref /*:: */) {
|
|
48607
|
+
var cellSize = _ref /*:: */.cellSize,
|
|
48608
|
+
cellSizeAndPositionManager = _ref /*:: */.cellSizeAndPositionManager,
|
|
48609
|
+
previousCellsCount = _ref /*:: */.previousCellsCount,
|
|
48610
|
+
previousCellSize = _ref /*:: */.previousCellSize,
|
|
48611
|
+
previousScrollToAlignment = _ref /*:: */.previousScrollToAlignment,
|
|
48612
|
+
previousScrollToIndex = _ref /*:: */.previousScrollToIndex,
|
|
48613
|
+
previousSize = _ref /*:: */.previousSize,
|
|
48614
|
+
scrollOffset = _ref /*:: */.scrollOffset,
|
|
48615
|
+
scrollToAlignment = _ref /*:: */.scrollToAlignment,
|
|
48616
|
+
scrollToIndex = _ref /*:: */.scrollToIndex,
|
|
48617
|
+
size = _ref /*:: */.size,
|
|
48618
|
+
sizeJustIncreasedFromZero = _ref /*:: */.sizeJustIncreasedFromZero,
|
|
48619
|
+
updateScrollIndexCallback = _ref /*:: */.updateScrollIndexCallback;
|
|
48649
48620
|
var cellCount = cellSizeAndPositionManager.getCellCount();
|
|
48650
48621
|
var hasScrollToIndex = scrollToIndex >= 0 && scrollToIndex < cellCount;
|
|
48651
|
-
var sizeHasChanged = size !== previousSize || sizeJustIncreasedFromZero || !previousCellSize || typeof cellSize === 'number' && cellSize !== previousCellSize;
|
|
48652
|
-
// We should ensure that the scroll target is visible.
|
|
48622
|
+
var sizeHasChanged = size !== previousSize || sizeJustIncreasedFromZero || !previousCellSize || typeof cellSize === 'number' && cellSize !== previousCellSize;
|
|
48653
48623
|
|
|
48624
|
+
// If we have a new scroll target OR if height/row-height has changed,
|
|
48625
|
+
// We should ensure that the scroll target is visible.
|
|
48654
48626
|
if (hasScrollToIndex && (sizeHasChanged || scrollToAlignment !== previousScrollToAlignment || scrollToIndex !== previousScrollToIndex)) {
|
|
48655
|
-
updateScrollIndexCallback(scrollToIndex);
|
|
48627
|
+
updateScrollIndexCallback(scrollToIndex);
|
|
48628
|
+
|
|
48629
|
+
// If we don't have a selected item but list size or number of children have decreased,
|
|
48656
48630
|
// Make sure we aren't scrolled too far past the current content.
|
|
48657
48631
|
} else if (!hasScrollToIndex && cellCount > 0 && (size < previousSize || cellCount < previousCellsCount)) {
|
|
48658
48632
|
// We need to ensure that the current scroll offset is still within the collection's range.
|
|
@@ -48667,35 +48641,37 @@ function updateScrollIndexHelper(_ref) {
|
|
|
48667
48641
|
;// CONCATENATED MODULE: ./node_modules/@box/react-virtualized/dist/es/Grid/defaultCellRangeRenderer.js
|
|
48668
48642
|
/*:: import type {CellRangeRendererParams} from './types';*/
|
|
48669
48643
|
|
|
48644
|
+
|
|
48670
48645
|
/**
|
|
48671
48646
|
* Default implementation of cellRangeRenderer used by Grid.
|
|
48672
48647
|
* This renderer supports cell-caching while the user is scrolling.
|
|
48673
48648
|
*/
|
|
48674
48649
|
|
|
48675
|
-
function defaultCellRangeRenderer(_ref) {
|
|
48676
|
-
var cellCache = _ref
|
|
48677
|
-
cellRenderer = _ref
|
|
48678
|
-
columnSizeAndPositionManager = _ref
|
|
48679
|
-
columnStartIndex = _ref
|
|
48680
|
-
columnStopIndex = _ref
|
|
48681
|
-
deferredMeasurementCache = _ref
|
|
48682
|
-
horizontalOffsetAdjustment = _ref
|
|
48683
|
-
isScrolling = _ref
|
|
48684
|
-
isScrollingOptOut = _ref
|
|
48685
|
-
parent = _ref
|
|
48686
|
-
rowSizeAndPositionManager = _ref
|
|
48687
|
-
rowStartIndex = _ref
|
|
48688
|
-
rowStopIndex = _ref
|
|
48689
|
-
styleCache = _ref
|
|
48690
|
-
verticalOffsetAdjustment = _ref
|
|
48691
|
-
visibleColumnIndices = _ref
|
|
48692
|
-
visibleRowIndices = _ref
|
|
48693
|
-
var renderedCells = [];
|
|
48650
|
+
function defaultCellRangeRenderer(_ref /*:: */) {
|
|
48651
|
+
var cellCache = _ref /*:: */.cellCache,
|
|
48652
|
+
cellRenderer = _ref /*:: */.cellRenderer,
|
|
48653
|
+
columnSizeAndPositionManager = _ref /*:: */.columnSizeAndPositionManager,
|
|
48654
|
+
columnStartIndex = _ref /*:: */.columnStartIndex,
|
|
48655
|
+
columnStopIndex = _ref /*:: */.columnStopIndex,
|
|
48656
|
+
deferredMeasurementCache = _ref /*:: */.deferredMeasurementCache,
|
|
48657
|
+
horizontalOffsetAdjustment = _ref /*:: */.horizontalOffsetAdjustment,
|
|
48658
|
+
isScrolling = _ref /*:: */.isScrolling,
|
|
48659
|
+
isScrollingOptOut = _ref /*:: */.isScrollingOptOut,
|
|
48660
|
+
parent = _ref /*:: */.parent,
|
|
48661
|
+
rowSizeAndPositionManager = _ref /*:: */.rowSizeAndPositionManager,
|
|
48662
|
+
rowStartIndex = _ref /*:: */.rowStartIndex,
|
|
48663
|
+
rowStopIndex = _ref /*:: */.rowStopIndex,
|
|
48664
|
+
styleCache = _ref /*:: */.styleCache,
|
|
48665
|
+
verticalOffsetAdjustment = _ref /*:: */.verticalOffsetAdjustment,
|
|
48666
|
+
visibleColumnIndices = _ref /*:: */.visibleColumnIndices,
|
|
48667
|
+
visibleRowIndices = _ref /*:: */.visibleRowIndices;
|
|
48668
|
+
var renderedCells = [];
|
|
48669
|
+
|
|
48670
|
+
// Browsers have native size limits for elements (eg Chrome 33M pixels, IE 1.5M pixes).
|
|
48694
48671
|
// User cannot scroll beyond these size limitations.
|
|
48695
48672
|
// In order to work around this, ScalingCellSizeAndPositionManager compresses offsets.
|
|
48696
48673
|
// We should never cache styles for compressed offsets though as this can lead to bugs.
|
|
48697
48674
|
// See issue #576 for more.
|
|
48698
|
-
|
|
48699
48675
|
var areOffsetsAdjusted = columnSizeAndPositionManager.areOffsetsAdjusted() || rowSizeAndPositionManager.areOffsetsAdjusted();
|
|
48700
48676
|
var canCacheStyle = !isScrolling && !areOffsetsAdjusted;
|
|
48701
48677
|
for (var rowIndex = rowStartIndex; rowIndex <= rowStopIndex; rowIndex++) {
|
|
@@ -48704,8 +48680,9 @@ function defaultCellRangeRenderer(_ref) {
|
|
|
48704
48680
|
var columnDatum = columnSizeAndPositionManager.getSizeAndPositionOfCell(columnIndex);
|
|
48705
48681
|
var isVisible = columnIndex >= visibleColumnIndices.start && columnIndex <= visibleColumnIndices.stop && rowIndex >= visibleRowIndices.start && rowIndex <= visibleRowIndices.stop;
|
|
48706
48682
|
var key = "".concat(rowIndex, "-").concat(columnIndex);
|
|
48707
|
-
var style = void 0;
|
|
48683
|
+
var style = void 0;
|
|
48708
48684
|
|
|
48685
|
+
// Cache style objects so shallow-compare doesn't re-render unnecessarily.
|
|
48709
48686
|
if (canCacheStyle && styleCache[key]) {
|
|
48710
48687
|
style = styleCache[key];
|
|
48711
48688
|
} else {
|
|
@@ -48742,7 +48719,9 @@ function defaultCellRangeRenderer(_ref) {
|
|
|
48742
48719
|
rowIndex: rowIndex,
|
|
48743
48720
|
style: style
|
|
48744
48721
|
};
|
|
48745
|
-
var renderedCell = void 0;
|
|
48722
|
+
var renderedCell = void 0;
|
|
48723
|
+
|
|
48724
|
+
// Avoid re-creating cells while scrolling.
|
|
48746
48725
|
// This can lead to the same cell being created many times and can cause performance issues for "heavy" cells.
|
|
48747
48726
|
// If a scroll is in progress- cache and reuse cells.
|
|
48748
48727
|
// This cache will be thrown away once scrolling completes.
|
|
@@ -48752,12 +48731,13 @@ function defaultCellRangeRenderer(_ref) {
|
|
|
48752
48731
|
//
|
|
48753
48732
|
// If isScrollingOptOut is specified, we always cache cells.
|
|
48754
48733
|
// For more info refer to issue #1028
|
|
48755
|
-
|
|
48756
48734
|
if ((isScrollingOptOut || isScrolling) && !horizontalOffsetAdjustment && !verticalOffsetAdjustment) {
|
|
48757
48735
|
if (!cellCache[key]) {
|
|
48758
48736
|
cellCache[key] = cellRenderer(cellRendererParams);
|
|
48759
48737
|
}
|
|
48760
|
-
renderedCell = cellCache[key];
|
|
48738
|
+
renderedCell = cellCache[key];
|
|
48739
|
+
|
|
48740
|
+
// If the user is no longer scrolling, don't cache cells.
|
|
48761
48741
|
// This makes dynamic cell content difficult for users and would also lead to a heavier memory footprint.
|
|
48762
48742
|
} else {
|
|
48763
48743
|
renderedCell = cellRenderer(cellRendererParams);
|
|
@@ -48804,9 +48784,7 @@ function scrollbarSize(recalc) {
|
|
|
48804
48784
|
var react_lifecycles_compat_es = __webpack_require__(62135);
|
|
48805
48785
|
;// CONCATENATED MODULE: ./node_modules/@box/react-virtualized/dist/es/utils/animationFrame.js
|
|
48806
48786
|
/*:: type Callback = (timestamp: number) => void;*/
|
|
48807
|
-
|
|
48808
48787
|
/*:: type CancelAnimationFrame = (requestId: number) => void;*/
|
|
48809
|
-
|
|
48810
48788
|
/*:: type RequestAnimationFrame = (callback: Callback) => number;*/
|
|
48811
48789
|
// Properly handle server-side rendering.
|
|
48812
48790
|
var win;
|
|
@@ -48816,49 +48794,36 @@ if (typeof window !== 'undefined') {
|
|
|
48816
48794
|
win = self;
|
|
48817
48795
|
} else {
|
|
48818
48796
|
win = {};
|
|
48819
|
-
}
|
|
48820
|
-
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
|
|
48797
|
+
}
|
|
48821
48798
|
|
|
48822
|
-
|
|
48823
|
-
|
|
48824
|
-
{
|
|
48825
|
-
return win
|
|
48826
|
-
|
|
48827
|
-
|
|
48828
|
-
|
|
48829
|
-
|
|
48830
|
-
|
|
48831
|
-
|
|
48832
|
-
};
|
|
48833
|
-
var raf
|
|
48834
|
-
/*: RequestAnimationFrame*/ = request
|
|
48835
|
-
/*: any*/;
|
|
48836
|
-
var caf
|
|
48837
|
-
/*: CancelAnimationFrame*/ = cancel
|
|
48838
|
-
/*: any*/;
|
|
48799
|
+
// requestAnimationFrame() shim by Paul Irish
|
|
48800
|
+
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
|
|
48801
|
+
var request = win.requestAnimationFrame || win.webkitRequestAnimationFrame || win.mozRequestAnimationFrame || win.oRequestAnimationFrame || win.msRequestAnimationFrame || function (callback /*: Callback*/) /*: RequestAnimationFrame*/{
|
|
48802
|
+
return win /*: any*/.setTimeout(callback, 1000 / 60);
|
|
48803
|
+
};
|
|
48804
|
+
var cancel = win.cancelAnimationFrame || win.webkitCancelAnimationFrame || win.mozCancelAnimationFrame || win.oCancelAnimationFrame || win.msCancelAnimationFrame || function (id /*: number*/) {
|
|
48805
|
+
win /*: any*/.clearTimeout(id);
|
|
48806
|
+
};
|
|
48807
|
+
var raf /*: RequestAnimationFrame*/ = request /*: any*/;
|
|
48808
|
+
var caf /*: CancelAnimationFrame*/ = cancel /*: any*/;
|
|
48839
48809
|
;// CONCATENATED MODULE: ./node_modules/@box/react-virtualized/dist/es/utils/requestAnimationTimeout.js
|
|
48840
48810
|
|
|
48841
48811
|
/*:: export type AnimationTimeoutId = {
|
|
48842
48812
|
id: number,
|
|
48843
48813
|
};*/
|
|
48844
|
-
|
|
48845
|
-
var cancelAnimationTimeout = function cancelAnimationTimeout(frame
|
|
48846
|
-
/*: AnimationTimeoutId*/) {
|
|
48814
|
+
var cancelAnimationTimeout = function cancelAnimationTimeout(frame /*: AnimationTimeoutId*/) {
|
|
48847
48815
|
return caf(frame.id);
|
|
48848
48816
|
};
|
|
48817
|
+
|
|
48849
48818
|
/**
|
|
48850
48819
|
* Recursively calls requestAnimationFrame until a specified delay has been met or exceeded.
|
|
48851
48820
|
* When the delay time has been reached the function you're timing out will be called.
|
|
48852
48821
|
*
|
|
48853
48822
|
* Credit: Joe Lambert (https://gist.github.com/joelambert/1002116#file-requesttimeout-js)
|
|
48854
48823
|
*/
|
|
48855
|
-
|
|
48856
|
-
var
|
|
48857
|
-
|
|
48858
|
-
/*: number*/) /*: AnimationTimeoutId*/
|
|
48859
|
-
{
|
|
48860
|
-
var start; // wait for end of processing current event handler, because event handler may be long
|
|
48861
|
-
|
|
48824
|
+
var requestAnimationTimeout = function requestAnimationTimeout(callback /*: Function*/, delay /*: number*/) /*: AnimationTimeoutId*/{
|
|
48825
|
+
var start;
|
|
48826
|
+
// wait for end of processing current event handler, because event handler may be long
|
|
48862
48827
|
Promise.resolve().then(function () {
|
|
48863
48828
|
start = Date.now();
|
|
48864
48829
|
});
|
|
@@ -48869,8 +48834,7 @@ var requestAnimationTimeout = function requestAnimationTimeout(callback
|
|
|
48869
48834
|
frame.id = raf(timeout);
|
|
48870
48835
|
}
|
|
48871
48836
|
};
|
|
48872
|
-
var frame
|
|
48873
|
-
/*: AnimationTimeoutId*/ = {
|
|
48837
|
+
var frame /*: AnimationTimeoutId*/ = {
|
|
48874
48838
|
id: raf(timeout)
|
|
48875
48839
|
};
|
|
48876
48840
|
return frame;
|
|
@@ -48884,36 +48848,38 @@ function _extends2() { return _extends2 = Object.assign ? Object.assign.bind() :
|
|
|
48884
48848
|
|
|
48885
48849
|
|
|
48886
48850
|
|
|
48887
|
-
|
|
48888
|
-
|
|
48889
|
-
var keys = Object.keys(object);
|
|
48851
|
+
function Grid_ownKeys(e, r) {
|
|
48852
|
+
var t = Object.keys(e);
|
|
48890
48853
|
if (Object.getOwnPropertySymbols) {
|
|
48891
|
-
var
|
|
48892
|
-
|
|
48893
|
-
return Object.getOwnPropertyDescriptor(
|
|
48894
|
-
});
|
|
48895
|
-
keys.push.apply(keys, symbols);
|
|
48854
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
48855
|
+
r && (o = o.filter(function (r) {
|
|
48856
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
48857
|
+
})), t.push.apply(t, o);
|
|
48896
48858
|
}
|
|
48897
|
-
return
|
|
48859
|
+
return t;
|
|
48898
48860
|
}
|
|
48899
|
-
function Grid_objectSpread(
|
|
48900
|
-
for (var
|
|
48901
|
-
var
|
|
48902
|
-
|
|
48903
|
-
|
|
48904
|
-
|
|
48905
|
-
|
|
48906
|
-
}
|
|
48907
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
48908
|
-
} else {
|
|
48909
|
-
Grid_ownKeys(source).forEach(function (key) {
|
|
48910
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
48911
|
-
});
|
|
48912
|
-
}
|
|
48861
|
+
function Grid_objectSpread(e) {
|
|
48862
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
48863
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
48864
|
+
r % 2 ? Grid_ownKeys(Object(t), !0).forEach(function (r) {
|
|
48865
|
+
defineProperty_defineProperty(e, r, t[r]);
|
|
48866
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : Grid_ownKeys(Object(t)).forEach(function (r) {
|
|
48867
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
48868
|
+
});
|
|
48913
48869
|
}
|
|
48914
|
-
return
|
|
48870
|
+
return e;
|
|
48871
|
+
}
|
|
48872
|
+
function Grid_callSuper(t, o, e) {
|
|
48873
|
+
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, Grid_isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
|
48874
|
+
}
|
|
48875
|
+
function Grid_isNativeReflectConstruct() {
|
|
48876
|
+
try {
|
|
48877
|
+
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
48878
|
+
} catch (t) {}
|
|
48879
|
+
return (Grid_isNativeReflectConstruct = function _isNativeReflectConstruct() {
|
|
48880
|
+
return !!t;
|
|
48881
|
+
})();
|
|
48915
48882
|
}
|
|
48916
|
-
|
|
48917
48883
|
/*:: import type {
|
|
48918
48884
|
CellRenderer,
|
|
48919
48885
|
CellRangeRenderer,
|
|
@@ -48929,7 +48895,6 @@ function Grid_objectSpread(target) {
|
|
|
48929
48895
|
CellCache,
|
|
48930
48896
|
StyleCache,
|
|
48931
48897
|
} from './types';*/
|
|
48932
|
-
|
|
48933
48898
|
/*:: import type {AnimationTimeoutId} from '../utils/requestAnimationTimeout';*/
|
|
48934
48899
|
|
|
48935
48900
|
|
|
@@ -48942,30 +48907,28 @@ function Grid_objectSpread(target) {
|
|
|
48942
48907
|
|
|
48943
48908
|
|
|
48944
48909
|
|
|
48910
|
+
|
|
48945
48911
|
/**
|
|
48946
48912
|
* Specifies the number of milliseconds during which to disable pointer events while a scroll is in progress.
|
|
48947
48913
|
* This improves performance and makes scrolling smoother.
|
|
48948
48914
|
*/
|
|
48949
|
-
|
|
48950
48915
|
var DEFAULT_SCROLLING_RESET_TIME_INTERVAL = 150;
|
|
48916
|
+
|
|
48951
48917
|
/**
|
|
48952
48918
|
* Controls whether the Grid updates the DOM element's scrollLeft/scrollTop based on the current state or just observes it.
|
|
48953
48919
|
* This prevents Grid from interrupting mouse-wheel animations (see issue #2).
|
|
48954
48920
|
*/
|
|
48955
|
-
|
|
48956
48921
|
var SCROLL_POSITION_CHANGE_REASONS = {
|
|
48957
48922
|
OBSERVED: 'observed',
|
|
48958
48923
|
REQUESTED: 'requested'
|
|
48959
48924
|
};
|
|
48960
|
-
var renderNull
|
|
48961
|
-
/*: NoContentRenderer*/ = function renderNull() {
|
|
48925
|
+
var renderNull /*: NoContentRenderer*/ = function renderNull /*: NoContentRenderer*/() {
|
|
48962
48926
|
return null;
|
|
48963
48927
|
};
|
|
48964
48928
|
/*:: type ScrollPosition = {
|
|
48965
48929
|
scrollTop?: number,
|
|
48966
48930
|
scrollLeft?: number,
|
|
48967
48931
|
};*/
|
|
48968
|
-
|
|
48969
48932
|
/*:: type Props = {
|
|
48970
48933
|
'aria-label': string,
|
|
48971
48934
|
'aria-readonly'?: boolean,
|
|
@@ -49131,7 +49094,6 @@ var renderNull
|
|
|
49131
49094
|
/** Width of Grid; this property determines the number of visible (vs virtualized) columns. *-/
|
|
49132
49095
|
width: number,
|
|
49133
49096
|
};*/
|
|
49134
|
-
|
|
49135
49097
|
/*:: type InstanceProps = {
|
|
49136
49098
|
prevColumnWidth: CellSize,
|
|
49137
49099
|
prevRowHeight: CellSize,
|
|
@@ -49148,7 +49110,6 @@ var renderNull
|
|
|
49148
49110
|
scrollbarSize: number,
|
|
49149
49111
|
scrollbarSizeMeasured: boolean,
|
|
49150
49112
|
};*/
|
|
49151
|
-
|
|
49152
49113
|
/*:: type State = {
|
|
49153
49114
|
instanceProps: InstanceProps,
|
|
49154
49115
|
isScrolling: boolean,
|
|
@@ -49159,54 +49120,49 @@ var renderNull
|
|
|
49159
49120
|
scrollPositionChangeReason: 'observed' | 'requested' | null,
|
|
49160
49121
|
needToResetStyleCache: boolean,
|
|
49161
49122
|
};*/
|
|
49162
|
-
|
|
49163
49123
|
/**
|
|
49164
49124
|
* Renders tabular data with virtualization along the vertical and horizontal axes.
|
|
49165
49125
|
* Row heights and column widths must be known ahead of time and specified as properties.
|
|
49166
49126
|
*/
|
|
49167
|
-
var Grid = /*#__PURE__*/
|
|
49168
|
-
function (
|
|
49169
|
-
_inherits(Grid, _React$PureComponent);
|
|
49170
|
-
|
|
49171
|
-
// Invokes onSectionRendered callback only when start/stop row or column indices change
|
|
49172
|
-
function Grid(props
|
|
49173
|
-
/*: Props*/) {
|
|
49127
|
+
var Grid = /*#__PURE__*/function (_React$PureComponent) {
|
|
49128
|
+
function Grid(props /*: Props*/) {
|
|
49174
49129
|
var _this;
|
|
49175
49130
|
_classCallCheck(this, Grid);
|
|
49176
|
-
_this =
|
|
49177
|
-
|
|
49178
|
-
defineProperty_defineProperty(
|
|
49179
|
-
defineProperty_defineProperty(
|
|
49180
|
-
defineProperty_defineProperty(
|
|
49181
|
-
defineProperty_defineProperty(
|
|
49182
|
-
defineProperty_defineProperty(
|
|
49183
|
-
defineProperty_defineProperty(
|
|
49184
|
-
defineProperty_defineProperty(
|
|
49185
|
-
defineProperty_defineProperty(
|
|
49186
|
-
defineProperty_defineProperty(
|
|
49187
|
-
defineProperty_defineProperty(
|
|
49188
|
-
defineProperty_defineProperty(
|
|
49189
|
-
defineProperty_defineProperty(
|
|
49190
|
-
defineProperty_defineProperty(
|
|
49191
|
-
defineProperty_defineProperty(
|
|
49192
|
-
defineProperty_defineProperty(
|
|
49193
|
-
defineProperty_defineProperty(
|
|
49194
|
-
defineProperty_defineProperty(
|
|
49195
|
-
defineProperty_defineProperty(
|
|
49196
|
-
defineProperty_defineProperty(
|
|
49197
|
-
defineProperty_defineProperty(
|
|
49198
|
-
defineProperty_defineProperty(
|
|
49199
|
-
defineProperty_defineProperty(
|
|
49200
|
-
defineProperty_defineProperty(
|
|
49201
|
-
defineProperty_defineProperty(
|
|
49202
|
-
|
|
49203
|
-
|
|
49131
|
+
_this = Grid_callSuper(this, Grid, [props]);
|
|
49132
|
+
// Invokes onSectionRendered callback only when start/stop row or column indices change
|
|
49133
|
+
defineProperty_defineProperty(_this, "_onGridRenderedMemoizer", createCallbackMemoizer());
|
|
49134
|
+
defineProperty_defineProperty(_this, "_onScrollMemoizer", createCallbackMemoizer(false));
|
|
49135
|
+
defineProperty_defineProperty(_this, "_deferredInvalidateColumnIndex", null);
|
|
49136
|
+
defineProperty_defineProperty(_this, "_deferredInvalidateRowIndex", null);
|
|
49137
|
+
defineProperty_defineProperty(_this, "_recomputeScrollLeftFlag", false);
|
|
49138
|
+
defineProperty_defineProperty(_this, "_recomputeScrollTopFlag", false);
|
|
49139
|
+
defineProperty_defineProperty(_this, "_horizontalScrollBarSize", 0);
|
|
49140
|
+
defineProperty_defineProperty(_this, "_verticalScrollBarSize", 0);
|
|
49141
|
+
defineProperty_defineProperty(_this, "_scrollbarPresenceChanged", false);
|
|
49142
|
+
defineProperty_defineProperty(_this, "_scrollingContainer", void 0);
|
|
49143
|
+
defineProperty_defineProperty(_this, "_childrenToDisplay", void 0);
|
|
49144
|
+
defineProperty_defineProperty(_this, "_columnStartIndex", void 0);
|
|
49145
|
+
defineProperty_defineProperty(_this, "_columnStopIndex", void 0);
|
|
49146
|
+
defineProperty_defineProperty(_this, "_rowStartIndex", void 0);
|
|
49147
|
+
defineProperty_defineProperty(_this, "_rowStopIndex", void 0);
|
|
49148
|
+
defineProperty_defineProperty(_this, "_renderedColumnStartIndex", 0);
|
|
49149
|
+
defineProperty_defineProperty(_this, "_renderedColumnStopIndex", 0);
|
|
49150
|
+
defineProperty_defineProperty(_this, "_renderedRowStartIndex", 0);
|
|
49151
|
+
defineProperty_defineProperty(_this, "_renderedRowStopIndex", 0);
|
|
49152
|
+
defineProperty_defineProperty(_this, "_initialScrollTop", void 0);
|
|
49153
|
+
defineProperty_defineProperty(_this, "_initialScrollLeft", void 0);
|
|
49154
|
+
defineProperty_defineProperty(_this, "_disablePointerEventsTimeoutId", void 0);
|
|
49155
|
+
defineProperty_defineProperty(_this, "_styleCache", {});
|
|
49156
|
+
defineProperty_defineProperty(_this, "_cellCache", {});
|
|
49157
|
+
defineProperty_defineProperty(_this, "_debounceScrollEndedCallback", function () {
|
|
49158
|
+
_this._disablePointerEventsTimeoutId = null;
|
|
49159
|
+
// isScrolling is used to determine if we reset styleCache
|
|
49204
49160
|
_this.setState({
|
|
49205
49161
|
isScrolling: false,
|
|
49206
49162
|
needToResetStyleCache: false
|
|
49207
49163
|
});
|
|
49208
49164
|
});
|
|
49209
|
-
defineProperty_defineProperty(
|
|
49165
|
+
defineProperty_defineProperty(_this, "_invokeOnGridRenderedHelper", function () {
|
|
49210
49166
|
var onSectionRendered = _this.props.onSectionRendered;
|
|
49211
49167
|
_this._onGridRenderedMemoizer({
|
|
49212
49168
|
callback: onSectionRendered,
|
|
@@ -49222,18 +49178,15 @@ function (_React$PureComponent) {
|
|
|
49222
49178
|
}
|
|
49223
49179
|
});
|
|
49224
49180
|
});
|
|
49225
|
-
defineProperty_defineProperty(
|
|
49226
|
-
/*: Element*/) {
|
|
49181
|
+
defineProperty_defineProperty(_this, "_setScrollingContainerRef", function (ref /*: Element*/) {
|
|
49227
49182
|
_this._scrollingContainer = ref;
|
|
49228
49183
|
});
|
|
49229
|
-
defineProperty_defineProperty(
|
|
49230
|
-
/*: Event*/) {
|
|
49184
|
+
defineProperty_defineProperty(_this, "_onScroll", function (event /*: Event*/) {
|
|
49231
49185
|
// In certain edge-cases React dispatches an onScroll event with an invalid target.scrollLeft / target.scrollTop.
|
|
49232
49186
|
// This invalid event can be detected by comparing event.target to this component's scrollable DOM element.
|
|
49233
49187
|
// See issue #404 for more information.
|
|
49234
49188
|
if (event.target === _this._scrollingContainer) {
|
|
49235
|
-
_this.handleScrollEvent(event.target
|
|
49236
|
-
/*: any*/);
|
|
49189
|
+
_this.handleScrollEvent(event.target /*: any*/);
|
|
49237
49190
|
}
|
|
49238
49191
|
});
|
|
49239
49192
|
var columnSizeAndPositionManager = new ScalingCellSizeAndPositionManager({
|
|
@@ -49280,11 +49233,12 @@ function (_React$PureComponent) {
|
|
|
49280
49233
|
}
|
|
49281
49234
|
return _this;
|
|
49282
49235
|
}
|
|
49236
|
+
|
|
49283
49237
|
/**
|
|
49284
49238
|
* Gets offsets for a given cell and alignment.
|
|
49285
49239
|
*/
|
|
49286
|
-
|
|
49287
|
-
_createClass(Grid, [{
|
|
49240
|
+
_inherits(Grid, _React$PureComponent);
|
|
49241
|
+
return _createClass(Grid, [{
|
|
49288
49242
|
key: "getOffsetForCell",
|
|
49289
49243
|
value: function getOffsetForCell() {
|
|
49290
49244
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
@@ -49294,7 +49248,7 @@ function (_React$PureComponent) {
|
|
|
49294
49248
|
columnIndex = _ref$columnIndex === void 0 ? this.props.scrollToColumn : _ref$columnIndex,
|
|
49295
49249
|
_ref$rowIndex = _ref.rowIndex,
|
|
49296
49250
|
rowIndex = _ref$rowIndex === void 0 ? this.props.scrollToRow : _ref$rowIndex;
|
|
49297
|
-
var offsetProps = Grid_objectSpread({}, this.props, {
|
|
49251
|
+
var offsetProps = Grid_objectSpread(Grid_objectSpread({}, this.props), {}, {
|
|
49298
49252
|
scrollToAlignment: alignment,
|
|
49299
49253
|
scrollToColumn: columnIndex,
|
|
49300
49254
|
scrollToRow: rowIndex
|
|
@@ -49304,6 +49258,7 @@ function (_React$PureComponent) {
|
|
|
49304
49258
|
scrollTop: this._getCalculatedScrollTop(offsetProps)
|
|
49305
49259
|
};
|
|
49306
49260
|
}
|
|
49261
|
+
|
|
49307
49262
|
/**
|
|
49308
49263
|
* Gets estimated total rows' height.
|
|
49309
49264
|
*/
|
|
@@ -49312,6 +49267,7 @@ function (_React$PureComponent) {
|
|
|
49312
49267
|
value: function getTotalRowsHeight() {
|
|
49313
49268
|
return this.state.instanceProps.rowSizeAndPositionManager.getTotalSize();
|
|
49314
49269
|
}
|
|
49270
|
+
|
|
49315
49271
|
/**
|
|
49316
49272
|
* Gets estimated total columns' width.
|
|
49317
49273
|
*/
|
|
@@ -49320,51 +49276,53 @@ function (_React$PureComponent) {
|
|
|
49320
49276
|
value: function getTotalColumnsWidth() {
|
|
49321
49277
|
return this.state.instanceProps.columnSizeAndPositionManager.getTotalSize();
|
|
49322
49278
|
}
|
|
49279
|
+
|
|
49323
49280
|
/**
|
|
49324
49281
|
* This method handles a scroll event originating from an external scroll control.
|
|
49325
49282
|
* It's an advanced method and should probably not be used unless you're implementing a custom scroll-bar solution.
|
|
49326
49283
|
*/
|
|
49327
49284
|
}, {
|
|
49328
49285
|
key: "handleScrollEvent",
|
|
49329
|
-
value: function handleScrollEvent(_ref2) {
|
|
49330
|
-
var _ref2$scrollLeft = _ref2
|
|
49286
|
+
value: function handleScrollEvent(_ref2 /*:: */) {
|
|
49287
|
+
var _ref2$scrollLeft = _ref2 /*:: */.scrollLeft,
|
|
49331
49288
|
scrollLeftParam = _ref2$scrollLeft === void 0 ? 0 : _ref2$scrollLeft,
|
|
49332
|
-
_ref2$scrollTop = _ref2
|
|
49289
|
+
_ref2$scrollTop = _ref2 /*:: */.scrollTop,
|
|
49333
49290
|
scrollTopParam = _ref2$scrollTop === void 0 ? 0 : _ref2$scrollTop;
|
|
49334
|
-
|
|
49335
49291
|
// On iOS, we can arrive at negative offsets by swiping past the start.
|
|
49336
49292
|
// To prevent flicker here, we make playing in the negative offset zone cause nothing to happen.
|
|
49337
49293
|
if (scrollTopParam < 0) {
|
|
49338
49294
|
return;
|
|
49339
|
-
}
|
|
49295
|
+
}
|
|
49340
49296
|
|
|
49297
|
+
// Prevent pointer events from interrupting a smooth scroll
|
|
49341
49298
|
this._debounceScrollEnded();
|
|
49342
49299
|
var _this$props = this.props,
|
|
49343
49300
|
autoHeight = _this$props.autoHeight,
|
|
49344
49301
|
autoWidth = _this$props.autoWidth,
|
|
49345
49302
|
height = _this$props.height,
|
|
49346
49303
|
width = _this$props.width;
|
|
49347
|
-
var instanceProps = this.state.instanceProps;
|
|
49304
|
+
var instanceProps = this.state.instanceProps;
|
|
49305
|
+
|
|
49306
|
+
// When this component is shrunk drastically, React dispatches a series of back-to-back scroll events,
|
|
49348
49307
|
// Gradually converging on a scrollTop that is within the bounds of the new, smaller height.
|
|
49349
49308
|
// This causes a series of rapid renders that is slow for long lists.
|
|
49350
49309
|
// We can avoid that by doing some simple bounds checking to ensure that scroll offsets never exceed their bounds.
|
|
49351
|
-
|
|
49352
49310
|
var scrollbarSize = instanceProps.scrollbarSize;
|
|
49353
49311
|
var totalRowsHeight = instanceProps.rowSizeAndPositionManager.getTotalSize();
|
|
49354
49312
|
var totalColumnsWidth = instanceProps.columnSizeAndPositionManager.getTotalSize();
|
|
49355
49313
|
var scrollLeft = Math.min(Math.max(0, totalColumnsWidth - width + scrollbarSize), scrollLeftParam);
|
|
49356
|
-
var scrollTop = Math.min(Math.max(0, totalRowsHeight - height + scrollbarSize), scrollTopParam);
|
|
49314
|
+
var scrollTop = Math.min(Math.max(0, totalRowsHeight - height + scrollbarSize), scrollTopParam);
|
|
49315
|
+
|
|
49316
|
+
// Certain devices (like Apple touchpad) rapid-fire duplicate events.
|
|
49357
49317
|
// Don't force a re-render if this is the case.
|
|
49358
49318
|
// The mouse may move faster then the animation frame does.
|
|
49359
49319
|
// Use requestAnimationFrame to avoid over-updating.
|
|
49360
|
-
|
|
49361
49320
|
if (this.state.scrollLeft !== scrollLeft || this.state.scrollTop !== scrollTop) {
|
|
49362
49321
|
// Track scrolling direction so we can more efficiently overscan rows to reduce empty space around the edges while scrolling.
|
|
49363
49322
|
// Don't change direction for an axis unless scroll offset has changed.
|
|
49364
49323
|
var scrollDirectionHorizontal = scrollLeft !== this.state.scrollLeft ? scrollLeft > this.state.scrollLeft ? SCROLL_DIRECTION_FORWARD : SCROLL_DIRECTION_BACKWARD : this.state.scrollDirectionHorizontal;
|
|
49365
49324
|
var scrollDirectionVertical = scrollTop !== this.state.scrollTop ? scrollTop > this.state.scrollTop ? SCROLL_DIRECTION_FORWARD : SCROLL_DIRECTION_BACKWARD : this.state.scrollDirectionVertical;
|
|
49366
|
-
var newState
|
|
49367
|
-
/*: $Shape<State>*/ = {
|
|
49325
|
+
var newState /*: $Shape<State>*/ = {
|
|
49368
49326
|
isScrolling: true,
|
|
49369
49327
|
scrollDirectionHorizontal: scrollDirectionHorizontal,
|
|
49370
49328
|
scrollDirectionVertical: scrollDirectionVertical,
|
|
@@ -49386,6 +49344,7 @@ function (_React$PureComponent) {
|
|
|
49386
49344
|
totalRowsHeight: totalRowsHeight
|
|
49387
49345
|
});
|
|
49388
49346
|
}
|
|
49347
|
+
|
|
49389
49348
|
/**
|
|
49390
49349
|
* Invalidate Grid size and recompute visible cells.
|
|
49391
49350
|
* This is a deferred wrapper for recomputeGridSize().
|
|
@@ -49395,12 +49354,13 @@ function (_React$PureComponent) {
|
|
|
49395
49354
|
// @TODO (bvaughn) Add automated test coverage for this.
|
|
49396
49355
|
}, {
|
|
49397
49356
|
key: "invalidateCellSizeAfterRender",
|
|
49398
|
-
value: function invalidateCellSizeAfterRender(_ref3) {
|
|
49399
|
-
var columnIndex = _ref3
|
|
49400
|
-
rowIndex = _ref3
|
|
49357
|
+
value: function invalidateCellSizeAfterRender(_ref3 /*:: */) {
|
|
49358
|
+
var columnIndex = _ref3 /*:: */.columnIndex,
|
|
49359
|
+
rowIndex = _ref3 /*:: */.rowIndex;
|
|
49401
49360
|
this._deferredInvalidateColumnIndex = typeof this._deferredInvalidateColumnIndex === 'number' ? Math.min(this._deferredInvalidateColumnIndex, columnIndex) : columnIndex;
|
|
49402
49361
|
this._deferredInvalidateRowIndex = typeof this._deferredInvalidateRowIndex === 'number' ? Math.min(this._deferredInvalidateRowIndex, rowIndex) : rowIndex;
|
|
49403
49362
|
}
|
|
49363
|
+
|
|
49404
49364
|
/**
|
|
49405
49365
|
* Pre-measure all columns and rows in a Grid.
|
|
49406
49366
|
* Typically cells are only measured as needed and estimated sizes are used for cells that have not yet been measured.
|
|
@@ -49416,6 +49376,7 @@ function (_React$PureComponent) {
|
|
|
49416
49376
|
instanceProps.columnSizeAndPositionManager.getSizeAndPositionOfCell(columnCount - 1);
|
|
49417
49377
|
instanceProps.rowSizeAndPositionManager.getSizeAndPositionOfCell(rowCount - 1);
|
|
49418
49378
|
}
|
|
49379
|
+
|
|
49419
49380
|
/**
|
|
49420
49381
|
* Forced recompute of row heights and column widths.
|
|
49421
49382
|
* This function should be called if dynamic column or row sizes have changed but nothing else has.
|
|
@@ -49434,37 +49395,41 @@ function (_React$PureComponent) {
|
|
|
49434
49395
|
scrollToRow = _this$props3.scrollToRow;
|
|
49435
49396
|
var instanceProps = this.state.instanceProps;
|
|
49436
49397
|
instanceProps.columnSizeAndPositionManager.resetCell(columnIndex);
|
|
49437
|
-
instanceProps.rowSizeAndPositionManager.resetCell(rowIndex);
|
|
49398
|
+
instanceProps.rowSizeAndPositionManager.resetCell(rowIndex);
|
|
49399
|
+
|
|
49400
|
+
// Cell sizes may be determined by a function property.
|
|
49438
49401
|
// In this case the cDU handler can't know if they changed.
|
|
49439
49402
|
// Store this flag to let the next cDU pass know it needs to recompute the scroll offset.
|
|
49440
|
-
|
|
49441
49403
|
this._recomputeScrollLeftFlag = scrollToColumn >= 0 && (this.state.scrollDirectionHorizontal === SCROLL_DIRECTION_FORWARD ? columnIndex <= scrollToColumn : columnIndex >= scrollToColumn);
|
|
49442
|
-
this._recomputeScrollTopFlag = scrollToRow >= 0 && (this.state.scrollDirectionVertical === SCROLL_DIRECTION_FORWARD ? rowIndex <= scrollToRow : rowIndex >= scrollToRow);
|
|
49443
|
-
// Invalid row heights likely mean invalid cached content as well.
|
|
49404
|
+
this._recomputeScrollTopFlag = scrollToRow >= 0 && (this.state.scrollDirectionVertical === SCROLL_DIRECTION_FORWARD ? rowIndex <= scrollToRow : rowIndex >= scrollToRow);
|
|
49444
49405
|
|
|
49406
|
+
// Clear cell cache in case we are scrolling;
|
|
49407
|
+
// Invalid row heights likely mean invalid cached content as well.
|
|
49445
49408
|
this._styleCache = {};
|
|
49446
49409
|
this._cellCache = {};
|
|
49447
49410
|
this.forceUpdate();
|
|
49448
49411
|
}
|
|
49412
|
+
|
|
49449
49413
|
/**
|
|
49450
49414
|
* Ensure column and row are visible.
|
|
49451
49415
|
*/
|
|
49452
49416
|
}, {
|
|
49453
49417
|
key: "scrollToCell",
|
|
49454
|
-
value: function scrollToCell(_ref5) {
|
|
49455
|
-
var columnIndex = _ref5
|
|
49456
|
-
rowIndex = _ref5
|
|
49418
|
+
value: function scrollToCell(_ref5 /*:: */) {
|
|
49419
|
+
var columnIndex = _ref5 /*:: */.columnIndex,
|
|
49420
|
+
rowIndex = _ref5 /*:: */.rowIndex;
|
|
49457
49421
|
var columnCount = this.props.columnCount;
|
|
49458
|
-
var props = this.props;
|
|
49459
|
-
// This can cause a funky scroll offset because of the vertical scrollbar width.
|
|
49422
|
+
var props = this.props;
|
|
49460
49423
|
|
|
49424
|
+
// Don't adjust scroll offset for single-column grids (eg List, Table).
|
|
49425
|
+
// This can cause a funky scroll offset because of the vertical scrollbar width.
|
|
49461
49426
|
if (columnCount > 1 && columnIndex !== undefined) {
|
|
49462
|
-
this._updateScrollLeftForScrollToColumn(Grid_objectSpread({}, props, {
|
|
49427
|
+
this._updateScrollLeftForScrollToColumn(Grid_objectSpread(Grid_objectSpread({}, props), {}, {
|
|
49463
49428
|
scrollToColumn: columnIndex
|
|
49464
49429
|
}));
|
|
49465
49430
|
}
|
|
49466
49431
|
if (rowIndex !== undefined) {
|
|
49467
|
-
this._updateScrollTopForScrollToRow(Grid_objectSpread({}, props, {
|
|
49432
|
+
this._updateScrollTopForScrollToRow(Grid_objectSpread(Grid_objectSpread({}, props), {}, {
|
|
49468
49433
|
scrollToRow: rowIndex
|
|
49469
49434
|
}));
|
|
49470
49435
|
}
|
|
@@ -49480,18 +49445,21 @@ function (_React$PureComponent) {
|
|
|
49480
49445
|
scrollTop = _this$props4.scrollTop,
|
|
49481
49446
|
scrollToRow = _this$props4.scrollToRow,
|
|
49482
49447
|
width = _this$props4.width;
|
|
49483
|
-
var instanceProps = this.state.instanceProps;
|
|
49448
|
+
var instanceProps = this.state.instanceProps;
|
|
49484
49449
|
|
|
49450
|
+
// Reset initial offsets to be ignored in browser
|
|
49485
49451
|
this._initialScrollTop = 0;
|
|
49486
|
-
this._initialScrollLeft = 0;
|
|
49452
|
+
this._initialScrollLeft = 0;
|
|
49453
|
+
|
|
49454
|
+
// If cell sizes have been invalidated (eg we are using CellMeasurer) then reset cached positions.
|
|
49487
49455
|
// We must do this at the start of the method as we may calculate and update scroll position below.
|
|
49456
|
+
this._handleInvalidatedGridSize();
|
|
49488
49457
|
|
|
49489
|
-
|
|
49458
|
+
// If this component was first rendered server-side, scrollbar size will be undefined.
|
|
49490
49459
|
// In that event we need to remeasure.
|
|
49491
|
-
|
|
49492
49460
|
if (!instanceProps.scrollbarSizeMeasured) {
|
|
49493
49461
|
this.setState(function (prevState) {
|
|
49494
|
-
var stateUpdate = Grid_objectSpread({}, prevState, {
|
|
49462
|
+
var stateUpdate = Grid_objectSpread(Grid_objectSpread({}, prevState), {}, {
|
|
49495
49463
|
needToResetStyleCache: false
|
|
49496
49464
|
});
|
|
49497
49465
|
stateUpdate.instanceProps.scrollbarSize = getScrollbarSize();
|
|
@@ -49509,8 +49477,9 @@ function (_React$PureComponent) {
|
|
|
49509
49477
|
stateUpdate.needToResetStyleCache = false;
|
|
49510
49478
|
this.setState(stateUpdate);
|
|
49511
49479
|
}
|
|
49512
|
-
}
|
|
49480
|
+
}
|
|
49513
49481
|
|
|
49482
|
+
// refs don't work in `react-test-renderer`
|
|
49514
49483
|
if (this._scrollingContainer) {
|
|
49515
49484
|
// setting the ref's scrollLeft and scrollTop.
|
|
49516
49485
|
// Somehow in MultiGrid the main grid doesn't trigger a update on mount.
|
|
@@ -49520,19 +49489,22 @@ function (_React$PureComponent) {
|
|
|
49520
49489
|
if (this._scrollingContainer.scrollTop !== this.state.scrollTop) {
|
|
49521
49490
|
this._scrollingContainer.scrollTop = this.state.scrollTop;
|
|
49522
49491
|
}
|
|
49523
|
-
}
|
|
49524
|
-
// Setting a state may cause us to later thing we've updated the offce when we haven't.
|
|
49492
|
+
}
|
|
49525
49493
|
|
|
49494
|
+
// Don't update scroll offset if the size is 0; we don't render any cells in this case.
|
|
49495
|
+
// Setting a state may cause us to later thing we've updated the offce when we haven't.
|
|
49526
49496
|
var sizeIsBiggerThanZero = height > 0 && width > 0;
|
|
49527
49497
|
if (scrollToColumn >= 0 && sizeIsBiggerThanZero) {
|
|
49528
49498
|
this._updateScrollLeftForScrollToColumn();
|
|
49529
49499
|
}
|
|
49530
49500
|
if (scrollToRow >= 0 && sizeIsBiggerThanZero) {
|
|
49531
49501
|
this._updateScrollTopForScrollToRow();
|
|
49532
|
-
}
|
|
49502
|
+
}
|
|
49533
49503
|
|
|
49534
|
-
|
|
49504
|
+
// Update onRowsRendered callback
|
|
49505
|
+
this._invokeOnGridRenderedHelper();
|
|
49535
49506
|
|
|
49507
|
+
// Initialize onScroll callback
|
|
49536
49508
|
this._invokeOnScrollMemoizer({
|
|
49537
49509
|
scrollLeft: scrollLeft || 0,
|
|
49538
49510
|
scrollTop: scrollTop || 0,
|
|
@@ -49541,6 +49513,7 @@ function (_React$PureComponent) {
|
|
|
49541
49513
|
});
|
|
49542
49514
|
this._maybeCallOnScrollbarPresenceChange();
|
|
49543
49515
|
}
|
|
49516
|
+
|
|
49544
49517
|
/**
|
|
49545
49518
|
* @private
|
|
49546
49519
|
* This method updates scrollLeft/scrollTop in state for the following conditions:
|
|
@@ -49548,9 +49521,7 @@ function (_React$PureComponent) {
|
|
|
49548
49521
|
*/
|
|
49549
49522
|
}, {
|
|
49550
49523
|
key: "componentDidUpdate",
|
|
49551
|
-
value: function componentDidUpdate(prevProps
|
|
49552
|
-
/*: Props*/, prevState
|
|
49553
|
-
/*: State*/) {
|
|
49524
|
+
value: function componentDidUpdate(prevProps /*: Props*/, prevState /*: State*/) {
|
|
49554
49525
|
var _this2 = this;
|
|
49555
49526
|
var _this$props5 = this.props,
|
|
49556
49527
|
autoHeight = _this$props5.autoHeight,
|
|
@@ -49566,19 +49537,21 @@ function (_React$PureComponent) {
|
|
|
49566
49537
|
scrollLeft = _this$state.scrollLeft,
|
|
49567
49538
|
scrollPositionChangeReason = _this$state.scrollPositionChangeReason,
|
|
49568
49539
|
scrollTop = _this$state.scrollTop,
|
|
49569
|
-
instanceProps = _this$state.instanceProps;
|
|
49540
|
+
instanceProps = _this$state.instanceProps;
|
|
49541
|
+
// If cell sizes have been invalidated (eg we are using CellMeasurer) then reset cached positions.
|
|
49570
49542
|
// We must do this at the start of the method as we may calculate and update scroll position below.
|
|
49543
|
+
this._handleInvalidatedGridSize();
|
|
49571
49544
|
|
|
49572
|
-
|
|
49545
|
+
// Handle edge case where column or row count has only just increased over 0.
|
|
49573
49546
|
// In this case we may have to restore a previously-specified scroll offset.
|
|
49574
49547
|
// For more info see bvaughn/react-virtualized/issues/218
|
|
49548
|
+
var columnOrRowCountJustIncreasedFromZero = columnCount > 0 && prevProps.columnCount === 0 || rowCount > 0 && prevProps.rowCount === 0;
|
|
49575
49549
|
|
|
49576
|
-
|
|
49550
|
+
// Make sure requested changes to :scrollLeft or :scrollTop get applied.
|
|
49577
49551
|
// Assigning to scrollLeft/scrollTop tells the browser to interrupt any running scroll animations,
|
|
49578
49552
|
// And to discard any pending async changes to the scroll position that may have happened in the meantime (e.g. on a separate scrolling thread).
|
|
49579
49553
|
// So we only set these when we require an adjustment of the scroll position.
|
|
49580
49554
|
// See issue #2 for more information.
|
|
49581
|
-
|
|
49582
49555
|
if (scrollPositionChangeReason === SCROLL_POSITION_CHANGE_REASONS.REQUESTED) {
|
|
49583
49556
|
// @TRICKY :autoHeight and :autoWidth properties instructs Grid to leave :scrollTop and :scrollLeft management to an external HOC (eg WindowScroller).
|
|
49584
49557
|
// In this case we should avoid checking scrollingContainer.scrollTop and scrollingContainer.scrollLeft since it forces layout/flow.
|
|
@@ -49588,13 +49561,15 @@ function (_React$PureComponent) {
|
|
|
49588
49561
|
if (!autoHeight && scrollTop >= 0 && (scrollTop !== this._scrollingContainer.scrollTop || columnOrRowCountJustIncreasedFromZero)) {
|
|
49589
49562
|
this._scrollingContainer.scrollTop = scrollTop;
|
|
49590
49563
|
}
|
|
49591
|
-
}
|
|
49564
|
+
}
|
|
49565
|
+
|
|
49566
|
+
// Special case where the previous size was 0:
|
|
49592
49567
|
// In this case we don't show any windowed cells at all.
|
|
49593
49568
|
// So we should always recalculate offset afterwards.
|
|
49569
|
+
var sizeJustIncreasedFromZero = (prevProps.width === 0 || prevProps.height === 0) && height > 0 && width > 0;
|
|
49594
49570
|
|
|
49595
|
-
|
|
49571
|
+
// Update scroll offsets if the current :scrollToColumn or :scrollToRow values requires it
|
|
49596
49572
|
// @TODO Do we also need this check or can the one in componentWillUpdate() suffice?
|
|
49597
|
-
|
|
49598
49573
|
if (this._recomputeScrollLeftFlag) {
|
|
49599
49574
|
this._recomputeScrollLeftFlag = false;
|
|
49600
49575
|
this._updateScrollLeftForScrollToColumn(this.props);
|
|
@@ -49636,10 +49611,12 @@ function (_React$PureComponent) {
|
|
|
49636
49611
|
return _this2._updateScrollTopForScrollToRow(_this2.props);
|
|
49637
49612
|
}
|
|
49638
49613
|
});
|
|
49639
|
-
}
|
|
49614
|
+
}
|
|
49640
49615
|
|
|
49641
|
-
|
|
49616
|
+
// Update onRowsRendered callback if start/stop indices have changed
|
|
49617
|
+
this._invokeOnGridRenderedHelper();
|
|
49642
49618
|
|
|
49619
|
+
// Changes to :scrollLeft or :scrollTop should also notify :onScroll listeners
|
|
49643
49620
|
if (scrollLeft !== prevState.scrollLeft || scrollTop !== prevState.scrollTop) {
|
|
49644
49621
|
var totalRowsHeight = instanceProps.rowSizeAndPositionManager.getTotalSize();
|
|
49645
49622
|
var totalColumnsWidth = instanceProps.columnSizeAndPositionManager.getTotalSize();
|
|
@@ -49659,6 +49636,7 @@ function (_React$PureComponent) {
|
|
|
49659
49636
|
cancelAnimationTimeout(this._disablePointerEventsTimeoutId);
|
|
49660
49637
|
}
|
|
49661
49638
|
}
|
|
49639
|
+
|
|
49662
49640
|
/**
|
|
49663
49641
|
* This method updates scrollLeft/scrollTop in state for the following conditions:
|
|
49664
49642
|
* 1) Empty content (0 rows or columns)
|
|
@@ -49687,8 +49665,7 @@ function (_React$PureComponent) {
|
|
|
49687
49665
|
instanceProps = _this$state2.instanceProps,
|
|
49688
49666
|
needToResetStyleCache = _this$state2.needToResetStyleCache;
|
|
49689
49667
|
var isScrolling = this._isScrolling();
|
|
49690
|
-
var gridStyle
|
|
49691
|
-
/*: Object*/ = {
|
|
49668
|
+
var gridStyle /*: Object*/ = {
|
|
49692
49669
|
boxSizing: 'border-box',
|
|
49693
49670
|
direction: 'ltr',
|
|
49694
49671
|
height: autoHeight ? 'auto' : height,
|
|
@@ -49699,31 +49676,35 @@ function (_React$PureComponent) {
|
|
|
49699
49676
|
};
|
|
49700
49677
|
if (needToResetStyleCache) {
|
|
49701
49678
|
this._styleCache = {};
|
|
49702
|
-
}
|
|
49703
|
-
// if state.isScrolling (not from _isScrolling) then reset
|
|
49679
|
+
}
|
|
49704
49680
|
|
|
49681
|
+
// calculate _styleCache here
|
|
49682
|
+
// if state.isScrolling (not from _isScrolling) then reset
|
|
49705
49683
|
if (!this.state.isScrolling) {
|
|
49706
49684
|
this._resetStyleCache();
|
|
49707
|
-
}
|
|
49685
|
+
}
|
|
49708
49686
|
|
|
49687
|
+
// calculate children to render here
|
|
49709
49688
|
this._calculateChildrenToRender(this.props, this.state);
|
|
49710
49689
|
var totalColumnsWidth = instanceProps.columnSizeAndPositionManager.getTotalSize();
|
|
49711
|
-
var totalRowsHeight = instanceProps.rowSizeAndPositionManager.getTotalSize();
|
|
49690
|
+
var totalRowsHeight = instanceProps.rowSizeAndPositionManager.getTotalSize();
|
|
49691
|
+
|
|
49692
|
+
// Force browser to hide scrollbars when we know they aren't necessary.
|
|
49712
49693
|
// Otherwise once scrollbars appear they may not disappear again.
|
|
49713
49694
|
// For more info see issue #116
|
|
49714
|
-
|
|
49715
49695
|
var verticalScrollBarSize = totalRowsHeight > height ? instanceProps.scrollbarSize : 0;
|
|
49716
49696
|
var horizontalScrollBarSize = totalColumnsWidth > width ? instanceProps.scrollbarSize : 0;
|
|
49717
49697
|
if (horizontalScrollBarSize !== this._horizontalScrollBarSize || verticalScrollBarSize !== this._verticalScrollBarSize) {
|
|
49718
49698
|
this._horizontalScrollBarSize = horizontalScrollBarSize;
|
|
49719
49699
|
this._verticalScrollBarSize = verticalScrollBarSize;
|
|
49720
49700
|
this._scrollbarPresenceChanged = true;
|
|
49721
|
-
}
|
|
49701
|
+
}
|
|
49702
|
+
|
|
49703
|
+
// Also explicitly init styles to 'auto' if scrollbars are required.
|
|
49722
49704
|
// This works around an obscure edge case where external CSS styles have not yet been loaded,
|
|
49723
49705
|
// But an initial scroll index of offset is set as an external prop.
|
|
49724
49706
|
// Without this style, Grid would render the correct range of cells but would NOT update its internal offset.
|
|
49725
49707
|
// This was originally reported via clauderic/react-infinite-calendar/issues/23
|
|
49726
|
-
|
|
49727
49708
|
gridStyle.overflowX = totalColumnsWidth + verticalScrollBarSize <= width ? 'hidden' : 'auto';
|
|
49728
49709
|
gridStyle.overflowY = totalRowsHeight + horizontalScrollBarSize <= height ? 'hidden' : 'auto';
|
|
49729
49710
|
var childrenToDisplay = this._childrenToDisplay;
|
|
@@ -49737,7 +49718,7 @@ function (_React$PureComponent) {
|
|
|
49737
49718
|
id: id,
|
|
49738
49719
|
onScroll: this._onScroll,
|
|
49739
49720
|
role: role,
|
|
49740
|
-
style: Grid_objectSpread({}, gridStyle,
|
|
49721
|
+
style: Grid_objectSpread(Grid_objectSpread({}, gridStyle), style),
|
|
49741
49722
|
tabIndex: tabIndex
|
|
49742
49723
|
}), childrenToDisplay.length > 0 && /*#__PURE__*/react.createElement("div", {
|
|
49743
49724
|
className: "ReactVirtualized__Grid__innerScrollContainer",
|
|
@@ -49753,14 +49734,13 @@ function (_React$PureComponent) {
|
|
|
49753
49734
|
}, containerStyle)
|
|
49754
49735
|
}, childrenToDisplay), showNoContentRenderer && noContentRenderer());
|
|
49755
49736
|
}
|
|
49737
|
+
|
|
49756
49738
|
/* ---------------------------- Helper methods ---------------------------- */
|
|
49757
49739
|
}, {
|
|
49758
49740
|
key: "_calculateChildrenToRender",
|
|
49759
49741
|
value: function _calculateChildrenToRender() {
|
|
49760
|
-
var props
|
|
49761
|
-
/*:
|
|
49762
|
-
var state
|
|
49763
|
-
/*: State*/ = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.state;
|
|
49742
|
+
var props /*: Props*/ = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props;
|
|
49743
|
+
var state /*: State*/ = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.state;
|
|
49764
49744
|
var cellRenderer = props.cellRenderer,
|
|
49765
49745
|
cellRangeRenderer = props.cellRangeRenderer,
|
|
49766
49746
|
columnCount = props.columnCount,
|
|
@@ -49778,8 +49758,9 @@ function (_React$PureComponent) {
|
|
|
49778
49758
|
var scrollTop = this._initialScrollTop > 0 ? this._initialScrollTop : state.scrollTop;
|
|
49779
49759
|
var scrollLeft = this._initialScrollLeft > 0 ? this._initialScrollLeft : state.scrollLeft;
|
|
49780
49760
|
var isScrolling = this._isScrolling(props, state);
|
|
49781
|
-
this._childrenToDisplay = [];
|
|
49761
|
+
this._childrenToDisplay = [];
|
|
49782
49762
|
|
|
49763
|
+
// Render only enough columns and rows to cover the visible area of the grid.
|
|
49783
49764
|
if (height > 0 && width > 0) {
|
|
49784
49765
|
var visibleColumnIndices = instanceProps.columnSizeAndPositionManager.getVisibleCellRange({
|
|
49785
49766
|
containerSize: width,
|
|
@@ -49796,8 +49777,9 @@ function (_React$PureComponent) {
|
|
|
49796
49777
|
var verticalOffsetAdjustment = instanceProps.rowSizeAndPositionManager.getOffsetAdjustment({
|
|
49797
49778
|
containerSize: height,
|
|
49798
49779
|
offset: scrollTop
|
|
49799
|
-
});
|
|
49780
|
+
});
|
|
49800
49781
|
|
|
49782
|
+
// Store for _invokeOnGridRenderedHelper()
|
|
49801
49783
|
this._renderedColumnStartIndex = visibleColumnIndices.start;
|
|
49802
49784
|
this._renderedColumnStopIndex = visibleColumnIndices.stop;
|
|
49803
49785
|
this._renderedRowStartIndex = visibleRowIndices.start;
|
|
@@ -49817,13 +49799,15 @@ function (_React$PureComponent) {
|
|
|
49817
49799
|
scrollDirection: scrollDirectionVertical,
|
|
49818
49800
|
startIndex: typeof visibleRowIndices.start === 'number' ? visibleRowIndices.start : 0,
|
|
49819
49801
|
stopIndex: typeof visibleRowIndices.stop === 'number' ? visibleRowIndices.stop : -1
|
|
49820
|
-
});
|
|
49802
|
+
});
|
|
49821
49803
|
|
|
49804
|
+
// Store for _invokeOnGridRenderedHelper()
|
|
49822
49805
|
var columnStartIndex = overscanColumnIndices.overscanStartIndex;
|
|
49823
49806
|
var columnStopIndex = overscanColumnIndices.overscanStopIndex;
|
|
49824
49807
|
var rowStartIndex = overscanRowIndices.overscanStartIndex;
|
|
49825
|
-
var rowStopIndex = overscanRowIndices.overscanStopIndex;
|
|
49808
|
+
var rowStopIndex = overscanRowIndices.overscanStopIndex;
|
|
49826
49809
|
|
|
49810
|
+
// Advanced use-cases (eg CellMeasurer) require batched measurements to determine accurate sizes.
|
|
49827
49811
|
if (deferredMeasurementCache) {
|
|
49828
49812
|
// If rows have a dynamic height, scan the rows we are about to render.
|
|
49829
49813
|
// If any have not yet been measured, then we need to render all columns initially,
|
|
@@ -49837,11 +49821,12 @@ function (_React$PureComponent) {
|
|
|
49837
49821
|
break;
|
|
49838
49822
|
}
|
|
49839
49823
|
}
|
|
49840
|
-
}
|
|
49824
|
+
}
|
|
49825
|
+
|
|
49826
|
+
// If columns have a dynamic width, scan the columns we are about to render.
|
|
49841
49827
|
// If any have not yet been measured, then we need to render all rows initially,
|
|
49842
49828
|
// Because the width of the column is equal to the widest cell within that column,
|
|
49843
49829
|
// (And so we can't know the width without measuring all row-cells first).
|
|
49844
|
-
|
|
49845
49830
|
if (!deferredMeasurementCache.hasFixedWidth()) {
|
|
49846
49831
|
for (var columnIndex = columnStartIndex; columnIndex <= columnStopIndex; columnIndex++) {
|
|
49847
49832
|
if (!deferredMeasurementCache.has(0, columnIndex)) {
|
|
@@ -49872,14 +49857,16 @@ function (_React$PureComponent) {
|
|
|
49872
49857
|
verticalOffsetAdjustment: verticalOffsetAdjustment,
|
|
49873
49858
|
visibleColumnIndices: visibleColumnIndices,
|
|
49874
49859
|
visibleRowIndices: visibleRowIndices
|
|
49875
|
-
});
|
|
49860
|
+
});
|
|
49876
49861
|
|
|
49862
|
+
// update the indices
|
|
49877
49863
|
this._columnStartIndex = columnStartIndex;
|
|
49878
49864
|
this._columnStopIndex = columnStopIndex;
|
|
49879
49865
|
this._rowStartIndex = rowStartIndex;
|
|
49880
49866
|
this._rowStopIndex = rowStopIndex;
|
|
49881
49867
|
}
|
|
49882
49868
|
}
|
|
49869
|
+
|
|
49883
49870
|
/**
|
|
49884
49871
|
* Sets an :isScrolling flag for a small window of time.
|
|
49885
49872
|
* This flag is used to disable pointer events on the scrollable portion of the Grid.
|
|
@@ -49896,11 +49883,12 @@ function (_React$PureComponent) {
|
|
|
49896
49883
|
}
|
|
49897
49884
|
}, {
|
|
49898
49885
|
key: "_handleInvalidatedGridSize",
|
|
49886
|
+
value:
|
|
49899
49887
|
/**
|
|
49900
49888
|
* Check for batched CellMeasurer size invalidations.
|
|
49901
49889
|
* This will occur the first time one or more previously unmeasured cells are rendered.
|
|
49902
49890
|
*/
|
|
49903
|
-
|
|
49891
|
+
function _handleInvalidatedGridSize() {
|
|
49904
49892
|
if (typeof this._deferredInvalidateColumnIndex === 'number' && typeof this._deferredInvalidateRowIndex === 'number') {
|
|
49905
49893
|
var columnIndex = this._deferredInvalidateColumnIndex;
|
|
49906
49894
|
var rowIndex = this._deferredInvalidateRowIndex;
|
|
@@ -49914,12 +49902,12 @@ function (_React$PureComponent) {
|
|
|
49914
49902
|
}
|
|
49915
49903
|
}, {
|
|
49916
49904
|
key: "_invokeOnScrollMemoizer",
|
|
49917
|
-
value: function _invokeOnScrollMemoizer(_ref6) {
|
|
49905
|
+
value: function _invokeOnScrollMemoizer(_ref6 /*:: */) {
|
|
49918
49906
|
var _this3 = this;
|
|
49919
|
-
var scrollLeft = _ref6
|
|
49920
|
-
scrollTop = _ref6
|
|
49921
|
-
totalColumnsWidth = _ref6
|
|
49922
|
-
totalRowsHeight = _ref6
|
|
49907
|
+
var scrollLeft = _ref6 /*:: */.scrollLeft,
|
|
49908
|
+
scrollTop = _ref6 /*:: */.scrollTop,
|
|
49909
|
+
totalColumnsWidth = _ref6 /*:: */.totalColumnsWidth,
|
|
49910
|
+
totalRowsHeight = _ref6 /*:: */.totalRowsHeight;
|
|
49923
49911
|
this._onScrollMemoizer({
|
|
49924
49912
|
callback: function callback(_ref7) {
|
|
49925
49913
|
var scrollLeft = _ref7.scrollLeft,
|
|
@@ -49945,12 +49933,9 @@ function (_React$PureComponent) {
|
|
|
49945
49933
|
}
|
|
49946
49934
|
}, {
|
|
49947
49935
|
key: "_isScrolling",
|
|
49948
|
-
value: function _isScrolling() /*: boolean*/
|
|
49949
|
-
|
|
49950
|
-
var
|
|
49951
|
-
/*: Props*/ = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props;
|
|
49952
|
-
var state
|
|
49953
|
-
/*: State*/ = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.state;
|
|
49936
|
+
value: function _isScrolling() /*: boolean*/{
|
|
49937
|
+
var props /*: Props*/ = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props;
|
|
49938
|
+
var state /*: State*/ = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.state;
|
|
49954
49939
|
// If isScrolling is defined in props, use it to override the value in state
|
|
49955
49940
|
// This is a performance optimization for WindowScroller + Grid
|
|
49956
49941
|
return Object.hasOwnProperty.call(props, 'isScrolling') ? Boolean(props.isScrolling) : Boolean(state.isScrolling);
|
|
@@ -49970,13 +49955,14 @@ function (_React$PureComponent) {
|
|
|
49970
49955
|
}
|
|
49971
49956
|
}, {
|
|
49972
49957
|
key: "scrollToPosition",
|
|
49958
|
+
value:
|
|
49973
49959
|
/**
|
|
49974
49960
|
* Scroll to the specified offset(s).
|
|
49975
49961
|
* Useful for animating position changes.
|
|
49976
49962
|
*/
|
|
49977
|
-
|
|
49978
|
-
var scrollLeft = _ref8
|
|
49979
|
-
scrollTop = _ref8
|
|
49963
|
+
function scrollToPosition(_ref8 /*:: */) {
|
|
49964
|
+
var scrollLeft = _ref8 /*:: */.scrollLeft,
|
|
49965
|
+
scrollTop = _ref8 /*:: */.scrollTop;
|
|
49980
49966
|
var stateUpdate = Grid._getScrollToPositionStateUpdate({
|
|
49981
49967
|
prevState: this.state,
|
|
49982
49968
|
scrollLeft: scrollLeft,
|
|
@@ -49990,19 +49976,15 @@ function (_React$PureComponent) {
|
|
|
49990
49976
|
}, {
|
|
49991
49977
|
key: "_getCalculatedScrollLeft",
|
|
49992
49978
|
value: function _getCalculatedScrollLeft() {
|
|
49993
|
-
var props
|
|
49994
|
-
/*:
|
|
49995
|
-
var state
|
|
49996
|
-
/*: State*/ = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.state;
|
|
49979
|
+
var props /*: Props*/ = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props;
|
|
49980
|
+
var state /*: State*/ = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.state;
|
|
49997
49981
|
return Grid._getCalculatedScrollLeft(props, state);
|
|
49998
49982
|
}
|
|
49999
49983
|
}, {
|
|
50000
49984
|
key: "_updateScrollLeftForScrollToColumn",
|
|
50001
49985
|
value: function _updateScrollLeftForScrollToColumn() {
|
|
50002
|
-
var props
|
|
50003
|
-
/*:
|
|
50004
|
-
var state
|
|
50005
|
-
/*: State*/ = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.state;
|
|
49986
|
+
var props /*: Props*/ = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props;
|
|
49987
|
+
var state /*: State*/ = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.state;
|
|
50006
49988
|
var stateUpdate = Grid._getScrollLeftForScrollToColumnStateUpdate(props, state);
|
|
50007
49989
|
if (stateUpdate) {
|
|
50008
49990
|
stateUpdate.needToResetStyleCache = false;
|
|
@@ -50012,10 +49994,8 @@ function (_React$PureComponent) {
|
|
|
50012
49994
|
}, {
|
|
50013
49995
|
key: "_getCalculatedScrollTop",
|
|
50014
49996
|
value: function _getCalculatedScrollTop() {
|
|
50015
|
-
var props
|
|
50016
|
-
/*:
|
|
50017
|
-
var state
|
|
50018
|
-
/*: State*/ = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.state;
|
|
49997
|
+
var props /*: Props*/ = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props;
|
|
49998
|
+
var state /*: State*/ = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.state;
|
|
50019
49999
|
return Grid._getCalculatedScrollTop(props, state);
|
|
50020
50000
|
}
|
|
50021
50001
|
}, {
|
|
@@ -50023,16 +50003,18 @@ function (_React$PureComponent) {
|
|
|
50023
50003
|
value: function _resetStyleCache() {
|
|
50024
50004
|
var styleCache = this._styleCache;
|
|
50025
50005
|
var cellCache = this._cellCache;
|
|
50026
|
-
var isScrollingOptOut = this.props.isScrollingOptOut;
|
|
50006
|
+
var isScrollingOptOut = this.props.isScrollingOptOut;
|
|
50007
|
+
|
|
50008
|
+
// Reset cell and style caches once scrolling stops.
|
|
50027
50009
|
// This makes Grid simpler to use (since cells commonly change).
|
|
50028
50010
|
// And it keeps the caches from growing too large.
|
|
50029
50011
|
// Performance is most sensitive when a user is scrolling.
|
|
50030
50012
|
// Don't clear visible cells from cellCache if isScrollingOptOut is specified.
|
|
50031
50013
|
// This keeps the cellCache to a resonable size.
|
|
50032
|
-
|
|
50033
50014
|
this._cellCache = {};
|
|
50034
|
-
this._styleCache = {};
|
|
50015
|
+
this._styleCache = {};
|
|
50035
50016
|
|
|
50017
|
+
// Copy over the visible cell styles so avoid unnecessary re-render.
|
|
50036
50018
|
for (var rowIndex = this._rowStartIndex; rowIndex <= this._rowStopIndex; rowIndex++) {
|
|
50037
50019
|
for (var columnIndex = this._columnStartIndex; columnIndex <= this._columnStopIndex; columnIndex++) {
|
|
50038
50020
|
var key = "".concat(rowIndex, "-").concat(columnIndex);
|
|
@@ -50046,10 +50028,8 @@ function (_React$PureComponent) {
|
|
|
50046
50028
|
}, {
|
|
50047
50029
|
key: "_updateScrollTopForScrollToRow",
|
|
50048
50030
|
value: function _updateScrollTopForScrollToRow() {
|
|
50049
|
-
var props
|
|
50050
|
-
/*:
|
|
50051
|
-
var state
|
|
50052
|
-
/*: State*/ = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.state;
|
|
50031
|
+
var props /*: Props*/ = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props;
|
|
50032
|
+
var state /*: State*/ = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.state;
|
|
50053
50033
|
var stateUpdate = Grid._getScrollTopForScrollToRowStateUpdate(props, state);
|
|
50054
50034
|
if (stateUpdate) {
|
|
50055
50035
|
stateUpdate.needToResetStyleCache = false;
|
|
@@ -50058,14 +50038,13 @@ function (_React$PureComponent) {
|
|
|
50058
50038
|
}
|
|
50059
50039
|
}], [{
|
|
50060
50040
|
key: "getDerivedStateFromProps",
|
|
50061
|
-
value: function getDerivedStateFromProps(nextProps
|
|
50062
|
-
/*: Props*/, prevState
|
|
50063
|
-
/*: State*/) /*: $Shape<State>*/
|
|
50064
|
-
{
|
|
50041
|
+
value: function getDerivedStateFromProps(nextProps /*: Props*/, prevState /*: State*/) /*: $Shape<State>*/{
|
|
50065
50042
|
var newState = {};
|
|
50066
50043
|
if (nextProps.columnCount === 0 && prevState.scrollLeft !== 0 || nextProps.rowCount === 0 && prevState.scrollTop !== 0) {
|
|
50067
50044
|
newState.scrollLeft = 0;
|
|
50068
|
-
newState.scrollTop = 0;
|
|
50045
|
+
newState.scrollTop = 0;
|
|
50046
|
+
|
|
50047
|
+
// only use scroll{Left,Top} from props if scrollTo{Column,Row} isn't specified
|
|
50069
50048
|
// scrollTo{Column,Row} should override scroll{Left,Top}
|
|
50070
50049
|
} else if (nextProps.scrollLeft !== prevState.scrollLeft && nextProps.scrollToColumn < 0 || nextProps.scrollTop !== prevState.scrollTop && nextProps.scrollToRow < 0) {
|
|
50071
50050
|
_extends2(newState, Grid._getScrollToPositionStateUpdate({
|
|
@@ -50074,8 +50053,9 @@ function (_React$PureComponent) {
|
|
|
50074
50053
|
scrollTop: nextProps.scrollTop
|
|
50075
50054
|
}));
|
|
50076
50055
|
}
|
|
50077
|
-
var instanceProps = prevState.instanceProps;
|
|
50056
|
+
var instanceProps = prevState.instanceProps;
|
|
50078
50057
|
|
|
50058
|
+
// Initially we should not clearStyleCache
|
|
50079
50059
|
newState.needToResetStyleCache = false;
|
|
50080
50060
|
if (nextProps.columnWidth !== instanceProps.prevColumnWidth || nextProps.rowHeight !== instanceProps.prevRowHeight) {
|
|
50081
50061
|
// Reset cache. set it to {} in render
|
|
@@ -50094,8 +50074,9 @@ function (_React$PureComponent) {
|
|
|
50094
50074
|
if (instanceProps.prevColumnCount === 0 || instanceProps.prevRowCount === 0) {
|
|
50095
50075
|
instanceProps.prevColumnCount = 0;
|
|
50096
50076
|
instanceProps.prevRowCount = 0;
|
|
50097
|
-
}
|
|
50077
|
+
}
|
|
50098
50078
|
|
|
50079
|
+
// If scrolling is controlled outside this component, clear cache when scrolling stops
|
|
50099
50080
|
if (nextProps.autoHeight && nextProps.isScrolling === false && instanceProps.prevIsScrolling === true) {
|
|
50100
50081
|
_extends2(newState, {
|
|
50101
50082
|
isScrolling: false
|
|
@@ -50139,8 +50120,9 @@ function (_React$PureComponent) {
|
|
|
50139
50120
|
instanceProps.prevRowCount = nextProps.rowCount;
|
|
50140
50121
|
instanceProps.prevRowHeight = nextProps.rowHeight;
|
|
50141
50122
|
instanceProps.prevScrollToColumn = nextProps.scrollToColumn;
|
|
50142
|
-
instanceProps.prevScrollToRow = nextProps.scrollToRow;
|
|
50123
|
+
instanceProps.prevScrollToRow = nextProps.scrollToRow;
|
|
50143
50124
|
|
|
50125
|
+
// getting scrollBarSize (moved from componentWillMount)
|
|
50144
50126
|
instanceProps.scrollbarSize = nextProps.getScrollbarSize();
|
|
50145
50127
|
if (instanceProps.scrollbarSize === undefined) {
|
|
50146
50128
|
instanceProps.scrollbarSizeMeasured = false;
|
|
@@ -50149,33 +50131,30 @@ function (_React$PureComponent) {
|
|
|
50149
50131
|
instanceProps.scrollbarSizeMeasured = true;
|
|
50150
50132
|
}
|
|
50151
50133
|
newState.instanceProps = instanceProps;
|
|
50152
|
-
return Grid_objectSpread({}, newState,
|
|
50134
|
+
return Grid_objectSpread(Grid_objectSpread(Grid_objectSpread({}, newState), maybeStateA), maybeStateB);
|
|
50153
50135
|
}
|
|
50154
50136
|
}, {
|
|
50155
50137
|
key: "_getEstimatedColumnSize",
|
|
50156
|
-
value: function _getEstimatedColumnSize(props
|
|
50157
|
-
/*: Props*/) {
|
|
50138
|
+
value: function _getEstimatedColumnSize(props /*: Props*/) {
|
|
50158
50139
|
return typeof props.columnWidth === 'number' ? props.columnWidth : props.estimatedColumnSize;
|
|
50159
50140
|
}
|
|
50160
50141
|
}, {
|
|
50161
50142
|
key: "_getEstimatedRowSize",
|
|
50162
|
-
value: function _getEstimatedRowSize(props
|
|
50163
|
-
/*: Props*/) {
|
|
50143
|
+
value: function _getEstimatedRowSize(props /*: Props*/) {
|
|
50164
50144
|
return typeof props.rowHeight === 'number' ? props.rowHeight : props.estimatedRowSize;
|
|
50165
50145
|
}
|
|
50166
50146
|
}, {
|
|
50167
50147
|
key: "_getScrollToPositionStateUpdate",
|
|
50148
|
+
value:
|
|
50168
50149
|
/**
|
|
50169
50150
|
* Get the updated state after scrolling to
|
|
50170
50151
|
* scrollLeft and scrollTop
|
|
50171
50152
|
*/
|
|
50172
|
-
|
|
50173
|
-
|
|
50174
|
-
|
|
50175
|
-
|
|
50176
|
-
|
|
50177
|
-
var newState
|
|
50178
|
-
/*: Object*/ = {
|
|
50153
|
+
function _getScrollToPositionStateUpdate(_ref9 /*:: */) /*: $Shape<State>*/{
|
|
50154
|
+
var prevState = _ref9 /*:: */.prevState,
|
|
50155
|
+
scrollLeft = _ref9 /*:: */.scrollLeft,
|
|
50156
|
+
scrollTop = _ref9 /*:: */.scrollTop;
|
|
50157
|
+
var newState /*: Object*/ = {
|
|
50179
50158
|
scrollPositionChangeReason: SCROLL_POSITION_CHANGE_REASONS.REQUESTED
|
|
50180
50159
|
};
|
|
50181
50160
|
if (typeof scrollLeft === 'number' && scrollLeft >= 0) {
|
|
@@ -50193,19 +50172,14 @@ function (_React$PureComponent) {
|
|
|
50193
50172
|
}
|
|
50194
50173
|
}, {
|
|
50195
50174
|
key: "_wrapSizeGetter",
|
|
50196
|
-
value: function _wrapSizeGetter(value
|
|
50197
|
-
/*: CellSize*/) /*: CellSizeGetter*/
|
|
50198
|
-
{
|
|
50175
|
+
value: function _wrapSizeGetter(value /*: CellSize*/) /*: CellSizeGetter*/{
|
|
50199
50176
|
return typeof value === 'function' ? value : function () {
|
|
50200
|
-
return value
|
|
50201
|
-
/*: any*/;
|
|
50177
|
+
return value /*: any*/;
|
|
50202
50178
|
};
|
|
50203
50179
|
}
|
|
50204
50180
|
}, {
|
|
50205
50181
|
key: "_getCalculatedScrollLeft",
|
|
50206
|
-
value: function _getCalculatedScrollLeft(nextProps
|
|
50207
|
-
/*: Props*/, prevState
|
|
50208
|
-
/*: State*/) {
|
|
50182
|
+
value: function _getCalculatedScrollLeft(nextProps /*: Props*/, prevState /*: State*/) {
|
|
50209
50183
|
var columnCount = nextProps.columnCount,
|
|
50210
50184
|
height = nextProps.height,
|
|
50211
50185
|
scrollToAlignment = nextProps.scrollToAlignment,
|
|
@@ -50229,10 +50203,7 @@ function (_React$PureComponent) {
|
|
|
50229
50203
|
}
|
|
50230
50204
|
}, {
|
|
50231
50205
|
key: "_getScrollLeftForScrollToColumnStateUpdate",
|
|
50232
|
-
value: function _getScrollLeftForScrollToColumnStateUpdate(nextProps
|
|
50233
|
-
/*: Props*/, prevState
|
|
50234
|
-
/*: State*/) /*: $Shape<State>*/
|
|
50235
|
-
{
|
|
50206
|
+
value: function _getScrollLeftForScrollToColumnStateUpdate(nextProps /*: Props*/, prevState /*: State*/) /*: $Shape<State>*/{
|
|
50236
50207
|
var scrollLeft = prevState.scrollLeft;
|
|
50237
50208
|
var calculatedScrollLeft = Grid._getCalculatedScrollLeft(nextProps, prevState);
|
|
50238
50209
|
if (typeof calculatedScrollLeft === 'number' && calculatedScrollLeft >= 0 && scrollLeft !== calculatedScrollLeft) {
|
|
@@ -50246,9 +50217,7 @@ function (_React$PureComponent) {
|
|
|
50246
50217
|
}
|
|
50247
50218
|
}, {
|
|
50248
50219
|
key: "_getCalculatedScrollTop",
|
|
50249
|
-
value: function _getCalculatedScrollTop(nextProps
|
|
50250
|
-
/*: Props*/, prevState
|
|
50251
|
-
/*: State*/) {
|
|
50220
|
+
value: function _getCalculatedScrollTop(nextProps /*: Props*/, prevState /*: State*/) {
|
|
50252
50221
|
var height = nextProps.height,
|
|
50253
50222
|
rowCount = nextProps.rowCount,
|
|
50254
50223
|
scrollToAlignment = nextProps.scrollToAlignment,
|
|
@@ -50272,10 +50241,7 @@ function (_React$PureComponent) {
|
|
|
50272
50241
|
}
|
|
50273
50242
|
}, {
|
|
50274
50243
|
key: "_getScrollTopForScrollToRowStateUpdate",
|
|
50275
|
-
value: function _getScrollTopForScrollToRowStateUpdate(nextProps
|
|
50276
|
-
/*: Props*/, prevState
|
|
50277
|
-
/*: State*/) /*: $Shape<State>*/
|
|
50278
|
-
{
|
|
50244
|
+
value: function _getScrollTopForScrollToRowStateUpdate(nextProps /*: Props*/, prevState /*: State*/) /*: $Shape<State>*/{
|
|
50279
50245
|
var scrollTop = prevState.scrollTop;
|
|
50280
50246
|
var calculatedScrollTop = Grid._getCalculatedScrollTop(nextProps, prevState);
|
|
50281
50247
|
if (typeof calculatedScrollTop === 'number' && calculatedScrollTop >= 0 && scrollTop !== calculatedScrollTop) {
|
|
@@ -50288,7 +50254,6 @@ function (_React$PureComponent) {
|
|
|
50288
50254
|
return {};
|
|
50289
50255
|
}
|
|
50290
50256
|
}]);
|
|
50291
|
-
return Grid;
|
|
50292
50257
|
}(react.PureComponent);
|
|
50293
50258
|
defineProperty_defineProperty(Grid, "defaultProps", {
|
|
50294
50259
|
'aria-label': 'grid',
|
|
@@ -50326,18 +50291,18 @@ var accessibilityOverscanIndicesGetter_SCROLL_DIRECTION_BACKWARD = (/* unused pu
|
|
|
50326
50291
|
var accessibilityOverscanIndicesGetter_SCROLL_DIRECTION_FORWARD = 1;
|
|
50327
50292
|
var accessibilityOverscanIndicesGetter_SCROLL_DIRECTION_HORIZONTAL = 'horizontal';
|
|
50328
50293
|
var accessibilityOverscanIndicesGetter_SCROLL_DIRECTION_VERTICAL = 'vertical';
|
|
50294
|
+
|
|
50329
50295
|
/**
|
|
50330
50296
|
* Calculates the number of cells to overscan before and after a specified range.
|
|
50331
50297
|
* This function ensures that overscanning doesn't exceed the available cells.
|
|
50332
50298
|
*/
|
|
50333
50299
|
|
|
50334
|
-
function accessibilityOverscanIndicesGetter_defaultOverscanIndicesGetter(_ref) /*: OverscanIndices*/
|
|
50335
|
-
|
|
50336
|
-
|
|
50337
|
-
|
|
50338
|
-
|
|
50339
|
-
|
|
50340
|
-
stopIndex = _ref.stopIndex;
|
|
50300
|
+
function accessibilityOverscanIndicesGetter_defaultOverscanIndicesGetter(_ref /*:: */) /*: OverscanIndices*/{
|
|
50301
|
+
var cellCount = _ref /*:: */.cellCount,
|
|
50302
|
+
overscanCellsCount = _ref /*:: */.overscanCellsCount,
|
|
50303
|
+
scrollDirection = _ref /*:: */.scrollDirection,
|
|
50304
|
+
startIndex = _ref /*:: */.startIndex,
|
|
50305
|
+
stopIndex = _ref /*:: */.stopIndex;
|
|
50341
50306
|
// Make sure we render at least 1 cell extra before and after (except near boundaries)
|
|
50342
50307
|
// This is necessary in order to support keyboard navigation (TAB/SHIFT+TAB) in some cases
|
|
50343
50308
|
// For more info see issues #625
|
|
@@ -50378,36 +50343,38 @@ function accessibilityOverscanIndicesGetter_defaultOverscanIndicesGetter(_ref) /
|
|
|
50378
50343
|
|
|
50379
50344
|
|
|
50380
50345
|
|
|
50381
|
-
|
|
50382
|
-
|
|
50383
|
-
var keys = Object.keys(object);
|
|
50346
|
+
function Table_ownKeys(e, r) {
|
|
50347
|
+
var t = Object.keys(e);
|
|
50384
50348
|
if (Object.getOwnPropertySymbols) {
|
|
50385
|
-
var
|
|
50386
|
-
|
|
50387
|
-
return Object.getOwnPropertyDescriptor(
|
|
50388
|
-
});
|
|
50389
|
-
keys.push.apply(keys, symbols);
|
|
50349
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
50350
|
+
r && (o = o.filter(function (r) {
|
|
50351
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
50352
|
+
})), t.push.apply(t, o);
|
|
50390
50353
|
}
|
|
50391
|
-
return
|
|
50354
|
+
return t;
|
|
50392
50355
|
}
|
|
50393
|
-
function Table_objectSpread(
|
|
50394
|
-
for (var
|
|
50395
|
-
var
|
|
50396
|
-
|
|
50397
|
-
|
|
50398
|
-
|
|
50399
|
-
|
|
50400
|
-
}
|
|
50401
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
50402
|
-
} else {
|
|
50403
|
-
Table_ownKeys(source).forEach(function (key) {
|
|
50404
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
50405
|
-
});
|
|
50406
|
-
}
|
|
50356
|
+
function Table_objectSpread(e) {
|
|
50357
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
50358
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
50359
|
+
r % 2 ? Table_ownKeys(Object(t), !0).forEach(function (r) {
|
|
50360
|
+
defineProperty_defineProperty(e, r, t[r]);
|
|
50361
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : Table_ownKeys(Object(t)).forEach(function (r) {
|
|
50362
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
50363
|
+
});
|
|
50407
50364
|
}
|
|
50408
|
-
return
|
|
50365
|
+
return e;
|
|
50366
|
+
}
|
|
50367
|
+
function Table_callSuper(t, o, e) {
|
|
50368
|
+
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, Table_isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
|
50369
|
+
}
|
|
50370
|
+
function Table_isNativeReflectConstruct() {
|
|
50371
|
+
try {
|
|
50372
|
+
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
50373
|
+
} catch (t) {}
|
|
50374
|
+
return (Table_isNativeReflectConstruct = function _isNativeReflectConstruct() {
|
|
50375
|
+
return !!t;
|
|
50376
|
+
})();
|
|
50409
50377
|
}
|
|
50410
|
-
|
|
50411
50378
|
/*:: import type {CellPosition} from '../Grid';*/
|
|
50412
50379
|
|
|
50413
50380
|
|
|
@@ -50418,35 +50385,35 @@ function Table_objectSpread(target) {
|
|
|
50418
50385
|
|
|
50419
50386
|
|
|
50420
50387
|
|
|
50388
|
+
|
|
50421
50389
|
/**
|
|
50422
50390
|
* Table component with fixed headers and virtualized rows for improved performance with large data sets.
|
|
50423
50391
|
* This component expects explicit width, height, and padding parameters.
|
|
50424
50392
|
*/
|
|
50425
|
-
|
|
50426
|
-
var Table_Table = /*#__PURE__*/
|
|
50427
|
-
function (_React$PureComponent) {
|
|
50428
|
-
_inherits(Table, _React$PureComponent);
|
|
50393
|
+
var Table_Table = /*#__PURE__*/function (_React$PureComponent) {
|
|
50429
50394
|
function Table(props) {
|
|
50430
50395
|
var _this;
|
|
50431
50396
|
_classCallCheck(this, Table);
|
|
50432
|
-
_this =
|
|
50397
|
+
_this = Table_callSuper(this, Table, [props]);
|
|
50433
50398
|
_this.state = {
|
|
50434
50399
|
scrollbarWidth: 0
|
|
50435
50400
|
};
|
|
50436
|
-
_this._createColumn = _this._createColumn.bind(
|
|
50437
|
-
_this._createRow = _this._createRow.bind(
|
|
50438
|
-
_this._onScroll = _this._onScroll.bind(
|
|
50439
|
-
_this._onSectionRendered = _this._onSectionRendered.bind(
|
|
50440
|
-
_this._setRef = _this._setRef.bind(
|
|
50401
|
+
_this._createColumn = _this._createColumn.bind(_this);
|
|
50402
|
+
_this._createRow = _this._createRow.bind(_this);
|
|
50403
|
+
_this._onScroll = _this._onScroll.bind(_this);
|
|
50404
|
+
_this._onSectionRendered = _this._onSectionRendered.bind(_this);
|
|
50405
|
+
_this._setRef = _this._setRef.bind(_this);
|
|
50441
50406
|
return _this;
|
|
50442
50407
|
}
|
|
50443
|
-
|
|
50408
|
+
_inherits(Table, _React$PureComponent);
|
|
50409
|
+
return _createClass(Table, [{
|
|
50444
50410
|
key: "forceUpdateGrid",
|
|
50445
50411
|
value: function forceUpdateGrid() {
|
|
50446
50412
|
if (this.Grid) {
|
|
50447
50413
|
this.Grid.forceUpdate();
|
|
50448
50414
|
}
|
|
50449
50415
|
}
|
|
50416
|
+
|
|
50450
50417
|
/** See Grid#getOffsetForCell */
|
|
50451
50418
|
}, {
|
|
50452
50419
|
key: "getOffsetForRow",
|
|
@@ -50463,12 +50430,13 @@ function (_React$PureComponent) {
|
|
|
50463
50430
|
}
|
|
50464
50431
|
return 0;
|
|
50465
50432
|
}
|
|
50433
|
+
|
|
50466
50434
|
/** CellMeasurer compatibility */
|
|
50467
50435
|
}, {
|
|
50468
50436
|
key: "invalidateCellSizeAfterRender",
|
|
50469
|
-
value: function invalidateCellSizeAfterRender(_ref2) {
|
|
50470
|
-
var columnIndex = _ref2
|
|
50471
|
-
rowIndex = _ref2
|
|
50437
|
+
value: function invalidateCellSizeAfterRender(_ref2 /*:: */) {
|
|
50438
|
+
var columnIndex = _ref2 /*:: */.columnIndex,
|
|
50439
|
+
rowIndex = _ref2 /*:: */.rowIndex;
|
|
50472
50440
|
if (this.Grid) {
|
|
50473
50441
|
this.Grid.invalidateCellSizeAfterRender({
|
|
50474
50442
|
rowIndex: rowIndex,
|
|
@@ -50476,6 +50444,7 @@ function (_React$PureComponent) {
|
|
|
50476
50444
|
});
|
|
50477
50445
|
}
|
|
50478
50446
|
}
|
|
50447
|
+
|
|
50479
50448
|
/** See Grid#measureAllCells */
|
|
50480
50449
|
}, {
|
|
50481
50450
|
key: "measureAllRows",
|
|
@@ -50484,6 +50453,7 @@ function (_React$PureComponent) {
|
|
|
50484
50453
|
this.Grid.measureAllCells();
|
|
50485
50454
|
}
|
|
50486
50455
|
}
|
|
50456
|
+
|
|
50487
50457
|
/** CellMeasurer compatibility */
|
|
50488
50458
|
}, {
|
|
50489
50459
|
key: "recomputeGridSize",
|
|
@@ -50500,6 +50470,7 @@ function (_React$PureComponent) {
|
|
|
50500
50470
|
});
|
|
50501
50471
|
}
|
|
50502
50472
|
}
|
|
50473
|
+
|
|
50503
50474
|
/** See Grid#recomputeGridSize */
|
|
50504
50475
|
}, {
|
|
50505
50476
|
key: "recomputeRowHeights",
|
|
@@ -50511,6 +50482,7 @@ function (_React$PureComponent) {
|
|
|
50511
50482
|
});
|
|
50512
50483
|
}
|
|
50513
50484
|
}
|
|
50485
|
+
|
|
50514
50486
|
/** See Grid#scrollToPosition */
|
|
50515
50487
|
}, {
|
|
50516
50488
|
key: "scrollToPosition",
|
|
@@ -50522,6 +50494,7 @@ function (_React$PureComponent) {
|
|
|
50522
50494
|
});
|
|
50523
50495
|
}
|
|
50524
50496
|
}
|
|
50497
|
+
|
|
50525
50498
|
/** See Grid#scrollToCell */
|
|
50526
50499
|
}, {
|
|
50527
50500
|
key: "scrollToRow",
|
|
@@ -50584,18 +50557,20 @@ function (_React$PureComponent) {
|
|
|
50584
50557
|
}) : rowClassName;
|
|
50585
50558
|
var rowStyleObject = typeof rowStyle === 'function' ? rowStyle({
|
|
50586
50559
|
index: -1
|
|
50587
|
-
}) : rowStyle;
|
|
50560
|
+
}) : rowStyle;
|
|
50588
50561
|
|
|
50562
|
+
// Precompute and cache column styles before rendering rows and columns to speed things up
|
|
50589
50563
|
this._cachedColumnStyles = [];
|
|
50590
50564
|
react.Children.toArray(children).forEach(function (column, index) {
|
|
50591
50565
|
var flexStyles = _this2._getFlexStyleForColumn(column, column.props.style);
|
|
50592
50566
|
_this2._cachedColumnStyles[index] = Table_objectSpread({
|
|
50593
50567
|
overflow: 'hidden'
|
|
50594
50568
|
}, flexStyles);
|
|
50595
|
-
});
|
|
50569
|
+
});
|
|
50570
|
+
|
|
50571
|
+
// Note that we specify :rowCount, :scrollbarWidth, :sortBy, and :sortDirection as properties on Grid even though these have nothing to do with Grid.
|
|
50596
50572
|
// This is done because Grid is a pure component and won't update unless its properties or state has changed.
|
|
50597
50573
|
// Any property that should trigger a re-render of Grid then is specified here to avoid a stale display.
|
|
50598
|
-
|
|
50599
50574
|
return /*#__PURE__*/react.createElement("div", {
|
|
50600
50575
|
"aria-label": this.props['aria-label'],
|
|
50601
50576
|
"aria-labelledby": this.props['aria-labelledby'],
|
|
@@ -50631,7 +50606,7 @@ function (_React$PureComponent) {
|
|
|
50631
50606
|
role: "rowgroup",
|
|
50632
50607
|
scrollbarWidth: scrollbarWidth,
|
|
50633
50608
|
scrollToRow: scrollToIndex,
|
|
50634
|
-
style: Table_objectSpread({}, gridStyle, {
|
|
50609
|
+
style: Table_objectSpread(Table_objectSpread({}, gridStyle), {}, {
|
|
50635
50610
|
overflowX: 'hidden'
|
|
50636
50611
|
})
|
|
50637
50612
|
})));
|
|
@@ -50677,10 +50652,11 @@ function (_React$PureComponent) {
|
|
|
50677
50652
|
});
|
|
50678
50653
|
};
|
|
50679
50654
|
var style = this._cachedColumnStyles[columnIndex];
|
|
50680
|
-
var title = typeof renderedCell === 'string' ? renderedCell : null;
|
|
50655
|
+
var title = typeof renderedCell === 'string' ? renderedCell : null;
|
|
50656
|
+
|
|
50657
|
+
// Avoid using object-spread syntax with multiple objects here,
|
|
50681
50658
|
// Since it results in an extra method call to 'babel-runtime/helpers/extends'
|
|
50682
50659
|
// See PR https://github.com/bvaughn/react-virtualized/pull/942
|
|
50683
|
-
|
|
50684
50660
|
return /*#__PURE__*/react.createElement("div", {
|
|
50685
50661
|
"aria-colindex": columnIndex + 1,
|
|
50686
50662
|
"aria-describedby": id,
|
|
@@ -50712,12 +50688,13 @@ function (_React$PureComponent) {
|
|
|
50712
50688
|
headerRenderer = _column$props2.headerRenderer,
|
|
50713
50689
|
headerRole = _column$props2.headerRole,
|
|
50714
50690
|
id = _column$props2.id,
|
|
50715
|
-
label = _column$props2.label
|
|
50691
|
+
label = _column$props2.label,
|
|
50692
|
+
preventAriaLabel = _column$props2.preventAriaLabel;
|
|
50716
50693
|
var sortEnabled = !disableSort && sort;
|
|
50717
50694
|
var classNames = clsx_m('ReactVirtualized__Table__headerColumn', headerClassName, column.props.headerClassName, {
|
|
50718
50695
|
ReactVirtualized__Table__sortableHeaderColumn: sortEnabled
|
|
50719
50696
|
});
|
|
50720
|
-
var style = this._getFlexStyleForColumn(column, Table_objectSpread({}, headerStyle,
|
|
50697
|
+
var style = this._getFlexStyleForColumn(column, Table_objectSpread(Table_objectSpread({}, headerStyle), column.props.headerStyle));
|
|
50721
50698
|
var renderedHeader = headerRenderer({
|
|
50722
50699
|
columnData: columnData,
|
|
50723
50700
|
dataKey: dataKey,
|
|
@@ -50726,13 +50703,22 @@ function (_React$PureComponent) {
|
|
|
50726
50703
|
sortBy: sortBy,
|
|
50727
50704
|
sortDirection: sortDirection
|
|
50728
50705
|
});
|
|
50729
|
-
var headerOnClick, headerOnKeyDown, headerTabIndex, headerAriaSort
|
|
50706
|
+
var headerOnClick, headerOnKeyDown, headerTabIndex, headerAriaSort;
|
|
50707
|
+
var headerAriaLabel = preventAriaLabel ? undefined : column.props['aria-label'] || label || dataKey;
|
|
50730
50708
|
if (sortEnabled || onHeaderClick) {
|
|
50731
50709
|
// If this is a sortable header, clicking it should update the table data's sorting.
|
|
50732
|
-
var isFirstTimeSort = sortBy !== dataKey;
|
|
50733
|
-
// Otherwise, invert the direction of the sort.
|
|
50710
|
+
var isFirstTimeSort = sortBy !== dataKey;
|
|
50734
50711
|
|
|
50735
|
-
|
|
50712
|
+
// If this is the firstTime sort of this column, use the column default sort order.
|
|
50713
|
+
// Otherwise, invert the direction of the sort.
|
|
50714
|
+
var newSortDirection;
|
|
50715
|
+
if (isFirstTimeSort) {
|
|
50716
|
+
newSortDirection = defaultSortDirection;
|
|
50717
|
+
} else if (sortDirection === Table_SortDirection.DESC) {
|
|
50718
|
+
newSortDirection = Table_SortDirection.ASC;
|
|
50719
|
+
} else {
|
|
50720
|
+
newSortDirection = Table_SortDirection.DESC;
|
|
50721
|
+
}
|
|
50736
50722
|
var onClick = function onClick(event) {
|
|
50737
50723
|
sortEnabled && sort({
|
|
50738
50724
|
defaultSortDirection: defaultSortDirection,
|
|
@@ -50751,7 +50737,6 @@ function (_React$PureComponent) {
|
|
|
50751
50737
|
onClick(event);
|
|
50752
50738
|
}
|
|
50753
50739
|
};
|
|
50754
|
-
headerAriaLabel = column.props['aria-label'] || label || dataKey;
|
|
50755
50740
|
headerAriaSort = 'none';
|
|
50756
50741
|
headerTabIndex = 0;
|
|
50757
50742
|
headerOnClick = onClick;
|
|
@@ -50759,10 +50744,11 @@ function (_React$PureComponent) {
|
|
|
50759
50744
|
}
|
|
50760
50745
|
if (sortBy === dataKey) {
|
|
50761
50746
|
headerAriaSort = sortDirection === Table_SortDirection.ASC ? 'ascending' : 'descending';
|
|
50762
|
-
}
|
|
50747
|
+
}
|
|
50748
|
+
|
|
50749
|
+
// Avoid using object-spread syntax with multiple objects here,
|
|
50763
50750
|
// Since it results in an extra method call to 'babel-runtime/helpers/extends'
|
|
50764
50751
|
// See PR https://github.com/bvaughn/react-virtualized/pull/942
|
|
50765
|
-
|
|
50766
50752
|
return /*#__PURE__*/react.createElement("div", {
|
|
50767
50753
|
"aria-label": headerAriaLabel,
|
|
50768
50754
|
"aria-sort": headerAriaSort,
|
|
@@ -50818,7 +50804,7 @@ function (_React$PureComponent) {
|
|
|
50818
50804
|
});
|
|
50819
50805
|
});
|
|
50820
50806
|
var className = clsx_m('ReactVirtualized__Table__row', rowClass);
|
|
50821
|
-
var flattenedStyle = Table_objectSpread({}, style, {
|
|
50807
|
+
var flattenedStyle = Table_objectSpread(Table_objectSpread({}, style), {}, {
|
|
50822
50808
|
height: this._getRowHeight(index),
|
|
50823
50809
|
overflow: 'hidden',
|
|
50824
50810
|
paddingRight: scrollbarWidth
|
|
@@ -50838,6 +50824,7 @@ function (_React$PureComponent) {
|
|
|
50838
50824
|
style: flattenedStyle
|
|
50839
50825
|
});
|
|
50840
50826
|
}
|
|
50827
|
+
|
|
50841
50828
|
/**
|
|
50842
50829
|
* Determines the flex-shrink, flex-grow, and width values for a cell (header or column).
|
|
50843
50830
|
*/
|
|
@@ -50846,7 +50833,7 @@ function (_React$PureComponent) {
|
|
|
50846
50833
|
value: function _getFlexStyleForColumn(column) {
|
|
50847
50834
|
var customStyle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
50848
50835
|
var flexValue = "".concat(column.props.flexGrow, " ").concat(column.props.flexShrink, " ").concat(column.props.width, "px");
|
|
50849
|
-
var style = Table_objectSpread({}, customStyle, {
|
|
50836
|
+
var style = Table_objectSpread(Table_objectSpread({}, customStyle), {}, {
|
|
50850
50837
|
flex: flexValue,
|
|
50851
50838
|
msFlex: flexValue,
|
|
50852
50839
|
WebkitFlex: flexValue
|
|
@@ -50924,7 +50911,6 @@ function (_React$PureComponent) {
|
|
|
50924
50911
|
});
|
|
50925
50912
|
}
|
|
50926
50913
|
}]);
|
|
50927
|
-
return Table;
|
|
50928
50914
|
}(react.PureComponent);
|
|
50929
50915
|
defineProperty_defineProperty(Table_Table, "defaultProps", {
|
|
50930
50916
|
disableHeader: false,
|
|
@@ -50979,6 +50965,7 @@ Table_Table.propTypes = false ? 0 : {};
|
|
|
50979
50965
|
* 4) Add nonce for style element.
|
|
50980
50966
|
* 5) Added support for injecting custom window object
|
|
50981
50967
|
**/
|
|
50968
|
+
|
|
50982
50969
|
function createDetectElementResize(nonce, hostWindow) {
|
|
50983
50970
|
// Check `document` and `window` in case of server-side rendering
|
|
50984
50971
|
var _window;
|
|
@@ -51042,8 +51029,8 @@ function createDetectElementResize(nonce, hostWindow) {
|
|
|
51042
51029
|
}
|
|
51043
51030
|
});
|
|
51044
51031
|
};
|
|
51045
|
-
/* Detect CSS Animations support to detect element display/re-attach */
|
|
51046
51032
|
|
|
51033
|
+
/* Detect CSS Animations support to detect element display/re-attach */
|
|
51047
51034
|
var animation = false,
|
|
51048
51035
|
keyframeprefix = '',
|
|
51049
51036
|
animationstartevent = 'animationstart',
|
|
@@ -51114,8 +51101,8 @@ function createDetectElementResize(nonce, hostWindow) {
|
|
|
51114
51101
|
element.appendChild(element.__resizeTriggers__);
|
|
51115
51102
|
resetTriggers(element);
|
|
51116
51103
|
element.addEventListener('scroll', scrollListener, true);
|
|
51117
|
-
/* Listen for a css animation to detect element display/re-attach */
|
|
51118
51104
|
|
|
51105
|
+
/* Listen for a css animation to detect element display/re-attach */
|
|
51119
51106
|
if (animationstartevent) {
|
|
51120
51107
|
element.__resizeTriggers__.__animationListener__ = function animationListener(e) {
|
|
51121
51108
|
if (e.animationName == animationName) {
|
|
@@ -51141,7 +51128,8 @@ function createDetectElementResize(nonce, hostWindow) {
|
|
|
51141
51128
|
}
|
|
51142
51129
|
try {
|
|
51143
51130
|
element.__resizeTriggers__ = !element.removeChild(element.__resizeTriggers__);
|
|
51144
|
-
} catch (e) {
|
|
51131
|
+
} catch (e) {
|
|
51132
|
+
// Preact compat; see developit/preact-compat/issues/228
|
|
51145
51133
|
}
|
|
51146
51134
|
}
|
|
51147
51135
|
}
|
|
@@ -51158,34 +51146,37 @@ function createDetectElementResize(nonce, hostWindow) {
|
|
|
51158
51146
|
|
|
51159
51147
|
|
|
51160
51148
|
|
|
51161
|
-
|
|
51162
|
-
|
|
51163
|
-
var keys = Object.keys(object);
|
|
51149
|
+
function AutoSizer_ownKeys(e, r) {
|
|
51150
|
+
var t = Object.keys(e);
|
|
51164
51151
|
if (Object.getOwnPropertySymbols) {
|
|
51165
|
-
var
|
|
51166
|
-
|
|
51167
|
-
return Object.getOwnPropertyDescriptor(
|
|
51168
|
-
});
|
|
51169
|
-
keys.push.apply(keys, symbols);
|
|
51152
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
51153
|
+
r && (o = o.filter(function (r) {
|
|
51154
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
51155
|
+
})), t.push.apply(t, o);
|
|
51170
51156
|
}
|
|
51171
|
-
return
|
|
51157
|
+
return t;
|
|
51172
51158
|
}
|
|
51173
|
-
function AutoSizer_objectSpread(
|
|
51174
|
-
for (var
|
|
51175
|
-
var
|
|
51176
|
-
|
|
51177
|
-
|
|
51178
|
-
|
|
51179
|
-
|
|
51180
|
-
}
|
|
51181
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
51182
|
-
} else {
|
|
51183
|
-
AutoSizer_ownKeys(source).forEach(function (key) {
|
|
51184
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
51185
|
-
});
|
|
51186
|
-
}
|
|
51159
|
+
function AutoSizer_objectSpread(e) {
|
|
51160
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
51161
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
51162
|
+
r % 2 ? AutoSizer_ownKeys(Object(t), !0).forEach(function (r) {
|
|
51163
|
+
defineProperty_defineProperty(e, r, t[r]);
|
|
51164
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : AutoSizer_ownKeys(Object(t)).forEach(function (r) {
|
|
51165
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
51166
|
+
});
|
|
51187
51167
|
}
|
|
51188
|
-
return
|
|
51168
|
+
return e;
|
|
51169
|
+
}
|
|
51170
|
+
function AutoSizer_callSuper(t, o, e) {
|
|
51171
|
+
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, AutoSizer_isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
|
51172
|
+
}
|
|
51173
|
+
function AutoSizer_isNativeReflectConstruct() {
|
|
51174
|
+
try {
|
|
51175
|
+
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
51176
|
+
} catch (t) {}
|
|
51177
|
+
return (AutoSizer_isNativeReflectConstruct = function _isNativeReflectConstruct() {
|
|
51178
|
+
return !!t;
|
|
51179
|
+
})();
|
|
51189
51180
|
}
|
|
51190
51181
|
|
|
51191
51182
|
|
|
@@ -51193,7 +51184,6 @@ function AutoSizer_objectSpread(target) {
|
|
|
51193
51184
|
height: number,
|
|
51194
51185
|
width: number,
|
|
51195
51186
|
};*/
|
|
51196
|
-
|
|
51197
51187
|
/*:: type Props = {
|
|
51198
51188
|
/** Function responsible for rendering children.*-/
|
|
51199
51189
|
children: Size => React.Element<*>,
|
|
@@ -51222,39 +51212,33 @@ function AutoSizer_objectSpread(target) {
|
|
|
51222
51212
|
/** Optional inline style *-/
|
|
51223
51213
|
style: ?Object,
|
|
51224
51214
|
};*/
|
|
51225
|
-
|
|
51226
51215
|
/*:: type State = {
|
|
51227
51216
|
height: number,
|
|
51228
51217
|
width: number,
|
|
51229
51218
|
};*/
|
|
51230
|
-
|
|
51231
51219
|
/*:: type ResizeHandler = (element: HTMLElement, onResize: () => void) => void;*/
|
|
51232
|
-
|
|
51233
51220
|
/*:: type DetectElementResize = {
|
|
51234
51221
|
addResizeListener: ResizeHandler,
|
|
51235
51222
|
removeResizeListener: ResizeHandler,
|
|
51236
51223
|
};*/
|
|
51237
|
-
|
|
51238
|
-
var AutoSizer = /*#__PURE__*/
|
|
51239
|
-
function (_React$Component) {
|
|
51240
|
-
_inherits(AutoSizer, _React$Component);
|
|
51224
|
+
var AutoSizer = /*#__PURE__*/function (_React$Component) {
|
|
51241
51225
|
function AutoSizer() {
|
|
51242
|
-
var _getPrototypeOf2;
|
|
51243
51226
|
var _this;
|
|
51244
51227
|
_classCallCheck(this, AutoSizer);
|
|
51245
51228
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
51246
51229
|
args[_key] = arguments[_key];
|
|
51247
51230
|
}
|
|
51248
|
-
_this =
|
|
51249
|
-
defineProperty_defineProperty(
|
|
51231
|
+
_this = AutoSizer_callSuper(this, AutoSizer, [].concat(args));
|
|
51232
|
+
defineProperty_defineProperty(_this, "state", {
|
|
51250
51233
|
height: _this.props.defaultHeight || 0,
|
|
51251
51234
|
width: _this.props.defaultWidth || 0
|
|
51252
51235
|
});
|
|
51253
|
-
defineProperty_defineProperty(
|
|
51254
|
-
defineProperty_defineProperty(
|
|
51255
|
-
defineProperty_defineProperty(
|
|
51256
|
-
|
|
51257
|
-
defineProperty_defineProperty(
|
|
51236
|
+
defineProperty_defineProperty(_this, "_parentNode", void 0);
|
|
51237
|
+
defineProperty_defineProperty(_this, "_autoSizer", void 0);
|
|
51238
|
+
defineProperty_defineProperty(_this, "_window", void 0);
|
|
51239
|
+
// uses any instead of Window because Flow doesn't have window type
|
|
51240
|
+
defineProperty_defineProperty(_this, "_detectElementResize", void 0);
|
|
51241
|
+
defineProperty_defineProperty(_this, "_onResize", function () {
|
|
51258
51242
|
var _this$props = _this.props,
|
|
51259
51243
|
disableHeight = _this$props.disableHeight,
|
|
51260
51244
|
disableWidth = _this$props.disableWidth,
|
|
@@ -51263,6 +51247,7 @@ function (_React$Component) {
|
|
|
51263
51247
|
// Guard against AutoSizer component being removed from the DOM immediately after being added.
|
|
51264
51248
|
// This can result in invalid style values which can result in NaN values if we don't handle them.
|
|
51265
51249
|
// See issue #150 for more context.
|
|
51250
|
+
|
|
51266
51251
|
var height = _this._parentNode.offsetHeight || 0;
|
|
51267
51252
|
var width = _this._parentNode.offsetWidth || 0;
|
|
51268
51253
|
var win = _this._window || window;
|
|
@@ -51285,13 +51270,13 @@ function (_React$Component) {
|
|
|
51285
51270
|
}
|
|
51286
51271
|
}
|
|
51287
51272
|
});
|
|
51288
|
-
defineProperty_defineProperty(
|
|
51289
|
-
/*: ?HTMLElement*/) {
|
|
51273
|
+
defineProperty_defineProperty(_this, "_setRef", function (autoSizer /*: ?HTMLElement*/) {
|
|
51290
51274
|
_this._autoSizer = autoSizer;
|
|
51291
51275
|
});
|
|
51292
51276
|
return _this;
|
|
51293
51277
|
}
|
|
51294
|
-
|
|
51278
|
+
_inherits(AutoSizer, _React$Component);
|
|
51279
|
+
return _createClass(AutoSizer, [{
|
|
51295
51280
|
key: "componentDidMount",
|
|
51296
51281
|
value: function componentDidMount() {
|
|
51297
51282
|
var nonce = this.props.nonce;
|
|
@@ -51300,9 +51285,10 @@ function (_React$Component) {
|
|
|
51300
51285
|
// This handles edge-cases where the component has already been unmounted before its ref has been set,
|
|
51301
51286
|
// As well as libraries like react-lite which have a slightly different lifecycle.
|
|
51302
51287
|
this._parentNode = this._autoSizer.parentNode;
|
|
51303
|
-
this._window = this._autoSizer.parentNode.ownerDocument.defaultView;
|
|
51304
|
-
// See issue #41
|
|
51288
|
+
this._window = this._autoSizer.parentNode.ownerDocument.defaultView;
|
|
51305
51289
|
|
|
51290
|
+
// Defer requiring resize handler in order to support server-side rendering.
|
|
51291
|
+
// See issue #41
|
|
51306
51292
|
this._detectElementResize = createDetectElementResize(nonce, this._window);
|
|
51307
51293
|
this._detectElementResize.addResizeListener(this._parentNode, this._onResize);
|
|
51308
51294
|
this._onResize();
|
|
@@ -51326,16 +51312,15 @@ function (_React$Component) {
|
|
|
51326
51312
|
style = _this$props2.style;
|
|
51327
51313
|
var _this$state = this.state,
|
|
51328
51314
|
height = _this$state.height,
|
|
51329
|
-
width = _this$state.width;
|
|
51315
|
+
width = _this$state.width;
|
|
51316
|
+
|
|
51317
|
+
// Outer div should not force width/height since that may prevent containers from shrinking.
|
|
51330
51318
|
// Inner component should overflow and use calculated width/height.
|
|
51331
51319
|
// See issue #68 for more information.
|
|
51332
|
-
|
|
51333
|
-
var outerStyle
|
|
51334
|
-
/*: Object*/ = {
|
|
51320
|
+
var outerStyle /*: Object*/ = {
|
|
51335
51321
|
overflow: 'visible'
|
|
51336
51322
|
};
|
|
51337
|
-
var childParams
|
|
51338
|
-
/*: Object*/ = {};
|
|
51323
|
+
var childParams /*: Object*/ = {};
|
|
51339
51324
|
if (!disableHeight) {
|
|
51340
51325
|
outerStyle.height = 0;
|
|
51341
51326
|
childParams.height = height;
|
|
@@ -51344,6 +51329,7 @@ function (_React$Component) {
|
|
|
51344
51329
|
outerStyle.width = 0;
|
|
51345
51330
|
childParams.width = width;
|
|
51346
51331
|
}
|
|
51332
|
+
|
|
51347
51333
|
/**
|
|
51348
51334
|
* TODO: Avoid rendering children before the initial measurements have been collected.
|
|
51349
51335
|
* At best this would just be wasting cycles.
|
|
@@ -51360,11 +51346,10 @@ function (_React$Component) {
|
|
|
51360
51346
|
return /*#__PURE__*/react.createElement("div", {
|
|
51361
51347
|
className: className,
|
|
51362
51348
|
ref: this._setRef,
|
|
51363
|
-
style: AutoSizer_objectSpread({}, outerStyle,
|
|
51349
|
+
style: AutoSizer_objectSpread(AutoSizer_objectSpread({}, outerStyle), style)
|
|
51364
51350
|
}, children(childParams));
|
|
51365
51351
|
}
|
|
51366
51352
|
}]);
|
|
51367
|
-
return AutoSizer;
|
|
51368
51353
|
}(react.Component);
|
|
51369
51354
|
defineProperty_defineProperty(AutoSizer, "defaultProps", {
|
|
51370
51355
|
onResize: function onResize() {},
|