|
|
|
|
@ -1,16 +1,16 @@
|
|
|
|
|
"use strict";
|
|
|
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[96232],{
|
|
|
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[39798],{
|
|
|
|
|
|
|
|
|
|
/***/ 96232:
|
|
|
|
|
/***/ 39798:
|
|
|
|
|
/*!***************************************************************************************!*\
|
|
|
|
|
!*** ./node_modules/_rc-virtual-list@3.11.3@rc-virtual-list/es/index.js + 16 modules ***!
|
|
|
|
|
!*** ./node_modules/_rc-virtual-list@3.11.4@rc-virtual-list/es/index.js + 16 modules ***!
|
|
|
|
|
\***************************************************************************************/
|
|
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
|
|
Z: function() { return /* binding */ _rc_virtual_list_3_11_3_rc_virtual_list_es; }
|
|
|
|
|
Z: function() { return /* binding */ _rc_virtual_list_3_11_4_rc_virtual_list_es; }
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.9@@babel/runtime/helpers/esm/extends.js
|
|
|
|
|
@ -34,7 +34,7 @@ var _classnames_2_5_1_classnames = __webpack_require__(92310);
|
|
|
|
|
var _classnames_2_5_1_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_5_1_classnames);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-resize-observer@1.4.0@rc-resize-observer/es/index.js + 4 modules
|
|
|
|
|
var es = __webpack_require__(28647);
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-virtual-list@3.11.3@rc-virtual-list/es/Filler.js
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-virtual-list@3.11.4@rc-virtual-list/es/Filler.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -60,16 +60,15 @@ var Filler = /*#__PURE__*/_react_17_0_2_react.forwardRef(function (_ref, ref) {
|
|
|
|
|
flexDirection: 'column'
|
|
|
|
|
};
|
|
|
|
|
if (offsetY !== undefined) {
|
|
|
|
|
var _objectSpread2;
|
|
|
|
|
// Not set `width` since this will break `sticky: right`
|
|
|
|
|
outerStyle = {
|
|
|
|
|
height: height,
|
|
|
|
|
position: 'relative',
|
|
|
|
|
overflow: 'hidden'
|
|
|
|
|
};
|
|
|
|
|
innerStyle = (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, innerStyle), {}, (_objectSpread2 = {
|
|
|
|
|
innerStyle = (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, innerStyle), {}, (0,defineProperty/* default */.Z)((0,defineProperty/* default */.Z)((0,defineProperty/* default */.Z)((0,defineProperty/* default */.Z)((0,defineProperty/* default */.Z)({
|
|
|
|
|
transform: "translateY(".concat(offsetY, "px)")
|
|
|
|
|
}, (0,defineProperty/* default */.Z)(_objectSpread2, rtl ? 'marginRight' : 'marginLeft', -offsetX), (0,defineProperty/* default */.Z)(_objectSpread2, "position", 'absolute'), (0,defineProperty/* default */.Z)(_objectSpread2, "left", 0), (0,defineProperty/* default */.Z)(_objectSpread2, "right", 0), (0,defineProperty/* default */.Z)(_objectSpread2, "top", 0), _objectSpread2));
|
|
|
|
|
}, rtl ? 'marginRight' : 'marginLeft', -offsetX), "position", 'absolute'), "left", 0), "right", 0), "top", 0));
|
|
|
|
|
}
|
|
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
|
|
|
style: outerStyle
|
|
|
|
|
@ -90,7 +89,7 @@ Filler.displayName = 'Filler';
|
|
|
|
|
/* harmony default export */ var es_Filler = (Filler);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.38.1@rc-util/es/raf.js
|
|
|
|
|
var raf = __webpack_require__(90571);
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-virtual-list@3.11.3@rc-virtual-list/es/ScrollBar.js
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-virtual-list@3.11.4@rc-virtual-list/es/ScrollBar.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -102,7 +101,6 @@ function getPageXY(e, horizontal) {
|
|
|
|
|
return obj[horizontal ? 'pageX' : 'pageY'];
|
|
|
|
|
}
|
|
|
|
|
var ScrollBar = /*#__PURE__*/_react_17_0_2_react.forwardRef(function (props, ref) {
|
|
|
|
|
var _classNames;
|
|
|
|
|
var prefixCls = props.prefixCls,
|
|
|
|
|
rtl = props.rtl,
|
|
|
|
|
scrollOffset = props.scrollOffset,
|
|
|
|
|
@ -128,9 +126,11 @@ var ScrollBar = /*#__PURE__*/_react_17_0_2_react.forwardRef(function (props, ref
|
|
|
|
|
startTop = _React$useState6[0],
|
|
|
|
|
setStartTop = _React$useState6[1];
|
|
|
|
|
var isLTR = !rtl;
|
|
|
|
|
|
|
|
|
|
// ========================= Refs =========================
|
|
|
|
|
var scrollbarRef = _react_17_0_2_react.useRef();
|
|
|
|
|
var thumbRef = _react_17_0_2_react.useRef();
|
|
|
|
|
|
|
|
|
|
// ======================= Visible ========================
|
|
|
|
|
var _React$useState7 = _react_17_0_2_react.useState(false),
|
|
|
|
|
_React$useState8 = (0,slicedToArray/* default */.Z)(_React$useState7, 2),
|
|
|
|
|
@ -144,11 +144,11 @@ var ScrollBar = /*#__PURE__*/_react_17_0_2_react.forwardRef(function (props, ref
|
|
|
|
|
setVisible(false);
|
|
|
|
|
}, 3000);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// ======================== Range =========================
|
|
|
|
|
var enableScrollRange = scrollRange - containerSize || 0;
|
|
|
|
|
var enableOffsetRange = containerSize - spinSize || 0;
|
|
|
|
|
// `scrollWidth` < `clientWidth` means no need to show scrollbar
|
|
|
|
|
var canScroll = enableScrollRange > 0;
|
|
|
|
|
|
|
|
|
|
// ========================= Top ==========================
|
|
|
|
|
var top = _react_17_0_2_react.useMemo(function () {
|
|
|
|
|
if (scrollOffset === 0 || enableScrollRange === 0) {
|
|
|
|
|
@ -157,11 +157,13 @@ var ScrollBar = /*#__PURE__*/_react_17_0_2_react.forwardRef(function (props, ref
|
|
|
|
|
var ptg = scrollOffset / enableScrollRange;
|
|
|
|
|
return ptg * enableOffsetRange;
|
|
|
|
|
}, [scrollOffset, enableScrollRange, enableOffsetRange]);
|
|
|
|
|
|
|
|
|
|
// ====================== Container =======================
|
|
|
|
|
var onContainerMouseDown = function onContainerMouseDown(e) {
|
|
|
|
|
e.stopPropagation();
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// ======================== Thumb =========================
|
|
|
|
|
var stateRef = _react_17_0_2_react.useRef({
|
|
|
|
|
top: top,
|
|
|
|
|
@ -183,7 +185,9 @@ var ScrollBar = /*#__PURE__*/_react_17_0_2_react.forwardRef(function (props, ref
|
|
|
|
|
e.stopPropagation();
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// ======================== Effect ========================
|
|
|
|
|
|
|
|
|
|
// React make event as passive, but we need to preventDefault
|
|
|
|
|
// Add event on dom directly instead.
|
|
|
|
|
// ref: https://github.com/facebook/react/issues/9809
|
|
|
|
|
@ -200,6 +204,7 @@ var ScrollBar = /*#__PURE__*/_react_17_0_2_react.forwardRef(function (props, ref
|
|
|
|
|
thumbEle.removeEventListener('touchstart', onThumbMouseDown);
|
|
|
|
|
};
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
// Pass to effect
|
|
|
|
|
var enableScrollRangeRef = _react_17_0_2_react.useRef();
|
|
|
|
|
enableScrollRangeRef.current = enableScrollRange;
|
|
|
|
|
@ -253,17 +258,19 @@ var ScrollBar = /*#__PURE__*/_react_17_0_2_react.forwardRef(function (props, ref
|
|
|
|
|
_react_17_0_2_react.useEffect(function () {
|
|
|
|
|
delayHidden();
|
|
|
|
|
}, [scrollOffset]);
|
|
|
|
|
|
|
|
|
|
// ====================== Imperative ======================
|
|
|
|
|
_react_17_0_2_react.useImperativeHandle(ref, function () {
|
|
|
|
|
return {
|
|
|
|
|
delayHidden: delayHidden
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// ======================== Render ========================
|
|
|
|
|
var scrollbarPrefixCls = "".concat(prefixCls, "-scrollbar");
|
|
|
|
|
var containerStyle = {
|
|
|
|
|
position: 'absolute',
|
|
|
|
|
visibility: visible && canScroll ? null : 'hidden'
|
|
|
|
|
visibility: visible ? null : 'hidden'
|
|
|
|
|
};
|
|
|
|
|
var thumbStyle = {
|
|
|
|
|
position: 'absolute',
|
|
|
|
|
@ -278,6 +285,7 @@ var ScrollBar = /*#__PURE__*/_react_17_0_2_react.forwardRef(function (props, ref
|
|
|
|
|
containerStyle.left = 0;
|
|
|
|
|
containerStyle.right = 0;
|
|
|
|
|
containerStyle.bottom = 0;
|
|
|
|
|
|
|
|
|
|
// Thumb
|
|
|
|
|
thumbStyle.height = '100%';
|
|
|
|
|
thumbStyle.width = spinSize;
|
|
|
|
|
@ -296,6 +304,7 @@ var ScrollBar = /*#__PURE__*/_react_17_0_2_react.forwardRef(function (props, ref
|
|
|
|
|
} else {
|
|
|
|
|
containerStyle.left = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Thumb
|
|
|
|
|
thumbStyle.width = '100%';
|
|
|
|
|
thumbStyle.height = spinSize;
|
|
|
|
|
@ -303,7 +312,7 @@ var ScrollBar = /*#__PURE__*/_react_17_0_2_react.forwardRef(function (props, ref
|
|
|
|
|
}
|
|
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
|
|
|
ref: scrollbarRef,
|
|
|
|
|
className: _classnames_2_5_1_classnames_default()(scrollbarPrefixCls, (_classNames = {}, (0,defineProperty/* default */.Z)(_classNames, "".concat(scrollbarPrefixCls, "-horizontal"), horizontal), (0,defineProperty/* default */.Z)(_classNames, "".concat(scrollbarPrefixCls, "-vertical"), !horizontal), (0,defineProperty/* default */.Z)(_classNames, "".concat(scrollbarPrefixCls, "-visible"), visible), _classNames)),
|
|
|
|
|
className: _classnames_2_5_1_classnames_default()(scrollbarPrefixCls, (0,defineProperty/* default */.Z)((0,defineProperty/* default */.Z)((0,defineProperty/* default */.Z)({}, "".concat(scrollbarPrefixCls, "-horizontal"), horizontal), "".concat(scrollbarPrefixCls, "-vertical"), !horizontal), "".concat(scrollbarPrefixCls, "-visible"), visible)),
|
|
|
|
|
style: (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, containerStyle), style),
|
|
|
|
|
onMouseDown: onContainerMouseDown,
|
|
|
|
|
onMouseMove: delayHidden
|
|
|
|
|
@ -316,7 +325,7 @@ var ScrollBar = /*#__PURE__*/_react_17_0_2_react.forwardRef(function (props, ref
|
|
|
|
|
});
|
|
|
|
|
if (false) {}
|
|
|
|
|
/* harmony default export */ var es_ScrollBar = (ScrollBar);
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-virtual-list@3.11.3@rc-virtual-list/es/Item.js
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-virtual-list@3.11.4@rc-virtual-list/es/Item.js
|
|
|
|
|
|
|
|
|
|
function Item(_ref) {
|
|
|
|
|
var children = _ref.children,
|
|
|
|
|
@ -328,7 +337,7 @@ function Item(_ref) {
|
|
|
|
|
ref: refFunc
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-virtual-list@3.11.3@rc-virtual-list/es/hooks/useChildren.js
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-virtual-list@3.11.4@rc-virtual-list/es/hooks/useChildren.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function useChildren(list, startIndex, endIndex, scrollWidth, setNodeRef, renderFunc, _ref) {
|
|
|
|
|
@ -355,17 +364,18 @@ var findDOMNode = __webpack_require__(58035);
|
|
|
|
|
var classCallCheck = __webpack_require__(61577);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.9@@babel/runtime/helpers/esm/createClass.js
|
|
|
|
|
var createClass = __webpack_require__(22946);
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-virtual-list@3.11.3@rc-virtual-list/es/utils/CacheMap.js
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-virtual-list@3.11.4@rc-virtual-list/es/utils/CacheMap.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Firefox has low performance of map.
|
|
|
|
|
var CacheMap = /*#__PURE__*/function () {
|
|
|
|
|
function CacheMap() {
|
|
|
|
|
(0,classCallCheck/* default */.Z)(this, CacheMap);
|
|
|
|
|
this.maps = void 0;
|
|
|
|
|
(0,defineProperty/* default */.Z)(this, "maps", void 0);
|
|
|
|
|
// Used for cache key
|
|
|
|
|
// `useMemo` no need to update if `id` not change
|
|
|
|
|
this.id = 0;
|
|
|
|
|
(0,defineProperty/* default */.Z)(this, "id", 0);
|
|
|
|
|
this.maps = Object.create(null);
|
|
|
|
|
}
|
|
|
|
|
(0,createClass/* default */.Z)(CacheMap, [{
|
|
|
|
|
@ -383,7 +393,7 @@ var CacheMap = /*#__PURE__*/function () {
|
|
|
|
|
return CacheMap;
|
|
|
|
|
}();
|
|
|
|
|
/* harmony default export */ var utils_CacheMap = (CacheMap);
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-virtual-list@3.11.3@rc-virtual-list/es/hooks/useHeights.js
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-virtual-list@3.11.4@rc-virtual-list/es/hooks/useHeights.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -414,6 +424,7 @@ function useHeights(getKey, onItemAdd, onItemRemove) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Always trigger update mark to tell parent that should re-calculate heights when resized
|
|
|
|
|
setUpdatedMark(function (c) {
|
|
|
|
|
return c + 1;
|
|
|
|
|
@ -434,12 +445,13 @@ function useHeights(getKey, onItemAdd, onItemRemove) {
|
|
|
|
|
} else {
|
|
|
|
|
instanceRef.current.delete(key);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Instance changed
|
|
|
|
|
if (!origin !== !instance) {
|
|
|
|
|
if (instance) {
|
|
|
|
|
onItemAdd === null || onItemAdd === void 0 ? void 0 : onItemAdd(item);
|
|
|
|
|
onItemAdd === null || onItemAdd === void 0 || onItemAdd(item);
|
|
|
|
|
} else {
|
|
|
|
|
onItemRemove === null || onItemRemove === void 0 ? void 0 : onItemRemove(item);
|
|
|
|
|
onItemRemove === null || onItemRemove === void 0 || onItemRemove(item);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -452,7 +464,7 @@ function useHeights(getKey, onItemAdd, onItemRemove) {
|
|
|
|
|
var useLayoutEffect = __webpack_require__(70658);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.38.1@rc-util/es/index.js
|
|
|
|
|
var _rc_util_5_38_1_rc_util_es = __webpack_require__(33401);
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-virtual-list@3.11.3@rc-virtual-list/es/hooks/useScrollTo.js
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-virtual-list@3.11.4@rc-virtual-list/es/hooks/useScrollTo.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -468,6 +480,7 @@ function useScrollTo(containerRef, data, heights, itemHeight, getKey, collectHei
|
|
|
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
|
|
|
syncState = _React$useState2[0],
|
|
|
|
|
setSyncState = _React$useState2[1];
|
|
|
|
|
|
|
|
|
|
// ========================== Sync Scroll ==========================
|
|
|
|
|
(0,useLayoutEffect/* default */.Z)(function () {
|
|
|
|
|
if (syncState && syncState.times < MAX_TIMES) {
|
|
|
|
|
@ -487,9 +500,11 @@ function useScrollTo(containerRef, data, heights, itemHeight, getKey, collectHei
|
|
|
|
|
var needCollectHeight = false;
|
|
|
|
|
var newTargetAlign = targetAlign;
|
|
|
|
|
var targetTop = null;
|
|
|
|
|
|
|
|
|
|
// Go to next frame if height not exist
|
|
|
|
|
if (height) {
|
|
|
|
|
var mergedAlign = targetAlign || originAlign;
|
|
|
|
|
|
|
|
|
|
// Get top & bottom
|
|
|
|
|
var stackTop = 0;
|
|
|
|
|
var itemTop = 0;
|
|
|
|
|
@ -502,6 +517,7 @@ function useScrollTo(containerRef, data, heights, itemHeight, getKey, collectHei
|
|
|
|
|
itemBottom = itemTop + (cacheHeight === undefined ? itemHeight : cacheHeight);
|
|
|
|
|
stackTop = itemBottom;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Check if need sync height (visible range has item not record height)
|
|
|
|
|
var leftHeight = mergedAlign === 'top' ? offset : height - offset;
|
|
|
|
|
for (var _i = maxLen; _i >= 0; _i -= 1) {
|
|
|
|
|
@ -516,6 +532,7 @@ function useScrollTo(containerRef, data, heights, itemHeight, getKey, collectHei
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Scroll to
|
|
|
|
|
switch (mergedAlign) {
|
|
|
|
|
case 'top':
|
|
|
|
|
@ -538,11 +555,13 @@ function useScrollTo(containerRef, data, heights, itemHeight, getKey, collectHei
|
|
|
|
|
if (targetTop !== null) {
|
|
|
|
|
syncScrollTop(targetTop);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// One more time for sync
|
|
|
|
|
if (targetTop !== syncState.lastTop) {
|
|
|
|
|
needCollectHeight = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Trigger next effect
|
|
|
|
|
if (needCollectHeight) {
|
|
|
|
|
setSyncState((0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, syncState), {}, {
|
|
|
|
|
@ -553,6 +572,7 @@ function useScrollTo(containerRef, data, heights, itemHeight, getKey, collectHei
|
|
|
|
|
}
|
|
|
|
|
} else if (false) {}
|
|
|
|
|
}, [syncState, containerRef.current]);
|
|
|
|
|
|
|
|
|
|
// =========================== Scroll To ===========================
|
|
|
|
|
return function (arg) {
|
|
|
|
|
// When not argument provided, we think dev may want to show the scrollbar
|
|
|
|
|
@ -560,6 +580,7 @@ function useScrollTo(containerRef, data, heights, itemHeight, getKey, collectHei
|
|
|
|
|
triggerFlash();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Normal scroll logic
|
|
|
|
|
raf/* default */.Z.cancel(scrollRef.current);
|
|
|
|
|
if (typeof arg === 'number') {
|
|
|
|
|
@ -585,7 +606,7 @@ function useScrollTo(containerRef, data, heights, itemHeight, getKey, collectHei
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-virtual-list@3.11.3@rc-virtual-list/es/utils/algorithmUtil.js
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-virtual-list@3.11.4@rc-virtual-list/es/utils/algorithmUtil.js
|
|
|
|
|
/**
|
|
|
|
|
* Get index with specific start index one by one. e.g.
|
|
|
|
|
* min: 3, max: 9, start: 6
|
|
|
|
|
@ -603,6 +624,7 @@ function getIndexByStartLoc(min, max, start, index) {
|
|
|
|
|
var beforeCount = start - min;
|
|
|
|
|
var afterCount = max - start;
|
|
|
|
|
var balanceCount = Math.min(beforeCount, afterCount) * 2;
|
|
|
|
|
|
|
|
|
|
// Balance
|
|
|
|
|
if (index <= balanceCount) {
|
|
|
|
|
var stepIndex = Math.floor(index / 2);
|
|
|
|
|
@ -611,12 +633,14 @@ function getIndexByStartLoc(min, max, start, index) {
|
|
|
|
|
}
|
|
|
|
|
return start - stepIndex;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// One is out of range
|
|
|
|
|
if (beforeCount > afterCount) {
|
|
|
|
|
return start - (index - afterCount);
|
|
|
|
|
}
|
|
|
|
|
return start + (index - beforeCount);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* We assume that 2 list has only 1 item diff and others keeping the order.
|
|
|
|
|
* So we can use dichotomy algorithm to find changed one.
|
|
|
|
|
@ -645,6 +669,7 @@ function findListDiffIndex(originList, targetList, getKey) {
|
|
|
|
|
}
|
|
|
|
|
return notExistKey;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Loop to find diff one
|
|
|
|
|
var diffIndex = null;
|
|
|
|
|
var multiple = Math.abs(originLen - targetLen) !== 1;
|
|
|
|
|
@ -662,7 +687,7 @@ function findListDiffIndex(originList, targetList, getKey) {
|
|
|
|
|
multiple: multiple
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-virtual-list@3.11.3@rc-virtual-list/es/hooks/useDiffItem.js
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-virtual-list@3.11.4@rc-virtual-list/es/hooks/useDiffItem.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -678,18 +703,18 @@ function useDiffItem(data, getKey, onDiff) {
|
|
|
|
|
_react_17_0_2_react.useEffect(function () {
|
|
|
|
|
var diff = findListDiffIndex(prevData || [], data || [], getKey);
|
|
|
|
|
if ((diff === null || diff === void 0 ? void 0 : diff.index) !== undefined) {
|
|
|
|
|
onDiff === null || onDiff === void 0 ? void 0 : onDiff(diff.index);
|
|
|
|
|
onDiff === null || onDiff === void 0 || onDiff(diff.index);
|
|
|
|
|
setDiffItem(data[diff.index]);
|
|
|
|
|
}
|
|
|
|
|
setPrevData(data);
|
|
|
|
|
}, [data]);
|
|
|
|
|
return [diffItem];
|
|
|
|
|
}
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-virtual-list@3.11.3@rc-virtual-list/es/utils/isFirefox.js
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-virtual-list@3.11.4@rc-virtual-list/es/utils/isFirefox.js
|
|
|
|
|
|
|
|
|
|
var isFF = (typeof navigator === "undefined" ? "undefined" : (0,esm_typeof/* default */.Z)(navigator)) === 'object' && /Firefox/i.test(navigator.userAgent);
|
|
|
|
|
/* harmony default export */ var isFirefox = (isFF);
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-virtual-list@3.11.3@rc-virtual-list/es/hooks/useOriginScroll.js
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-virtual-list@3.11.4@rc-virtual-list/es/hooks/useOriginScroll.js
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ var useOriginScroll = (function (isScrollAtTop, isScrollAtBottom) {
|
|
|
|
|
// Do lock for a wheel when scrolling
|
|
|
|
|
@ -702,6 +727,7 @@ var isFF = (typeof navigator === "undefined" ? "undefined" : (0,esm_typeof/* def
|
|
|
|
|
lockRef.current = false;
|
|
|
|
|
}, 50);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Pass to ref since global add is in closure
|
|
|
|
|
var scrollPingRef = (0,_react_17_0_2_react.useRef)({
|
|
|
|
|
top: isScrollAtTop,
|
|
|
|
|
@ -726,7 +752,7 @@ var isFF = (typeof navigator === "undefined" ? "undefined" : (0,esm_typeof/* def
|
|
|
|
|
return !lockRef.current && originScroll;
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-virtual-list@3.11.3@rc-virtual-list/es/hooks/useFrameWheel.js
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-virtual-list@3.11.4@rc-virtual-list/es/hooks/useFrameWheel.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -738,17 +764,21 @@ function useFrameWheel(inVirtual, isScrollAtTop, isScrollAtBottom, horizontalScr
|
|
|
|
|
onWheelDelta) {
|
|
|
|
|
var offsetRef = (0,_react_17_0_2_react.useRef)(0);
|
|
|
|
|
var nextFrameRef = (0,_react_17_0_2_react.useRef)(null);
|
|
|
|
|
|
|
|
|
|
// Firefox patch
|
|
|
|
|
var wheelValueRef = (0,_react_17_0_2_react.useRef)(null);
|
|
|
|
|
var isMouseScrollRef = (0,_react_17_0_2_react.useRef)(false);
|
|
|
|
|
|
|
|
|
|
// Scroll status sync
|
|
|
|
|
var originScroll = useOriginScroll(isScrollAtTop, isScrollAtBottom);
|
|
|
|
|
function onWheelY(event, deltaY) {
|
|
|
|
|
raf/* default */.Z.cancel(nextFrameRef.current);
|
|
|
|
|
offsetRef.current += deltaY;
|
|
|
|
|
wheelValueRef.current = deltaY;
|
|
|
|
|
|
|
|
|
|
// Do nothing when scroll at the edge, Skip check when is in scroll
|
|
|
|
|
if (originScroll(deltaY)) return;
|
|
|
|
|
|
|
|
|
|
// Proxy of scroll events
|
|
|
|
|
if (!isFirefox) {
|
|
|
|
|
event.preventDefault();
|
|
|
|
|
@ -767,11 +797,13 @@ onWheelDelta) {
|
|
|
|
|
event.preventDefault();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Check for which direction does wheel do. `sx` means `shift + wheel`
|
|
|
|
|
var wheelDirectionRef = (0,_react_17_0_2_react.useRef)(null);
|
|
|
|
|
var wheelDirectionCleanRef = (0,_react_17_0_2_react.useRef)(null);
|
|
|
|
|
function onWheel(event) {
|
|
|
|
|
if (!inVirtual) return;
|
|
|
|
|
|
|
|
|
|
// Wait for 2 frame to clean direction
|
|
|
|
|
raf/* default */.Z.cancel(wheelDirectionCleanRef.current);
|
|
|
|
|
wheelDirectionCleanRef.current = (0,raf/* default */.Z)(function () {
|
|
|
|
|
@ -798,6 +830,7 @@ onWheelDelta) {
|
|
|
|
|
onWheelX(event, mergedDeltaX);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// A patch for firefox
|
|
|
|
|
function onFireFoxScroll(event) {
|
|
|
|
|
if (!inVirtual) return;
|
|
|
|
|
@ -805,7 +838,7 @@ onWheelDelta) {
|
|
|
|
|
}
|
|
|
|
|
return [onWheel, onFireFoxScroll];
|
|
|
|
|
}
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-virtual-list@3.11.3@rc-virtual-list/es/hooks/useMobileTouchMove.js
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-virtual-list@3.11.4@rc-virtual-list/es/hooks/useMobileTouchMove.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var SMOOTH_PTG = 14 / 15;
|
|
|
|
|
@ -813,23 +846,26 @@ function useMobileTouchMove(inVirtual, listRef, callback) {
|
|
|
|
|
var touchedRef = (0,_react_17_0_2_react.useRef)(false);
|
|
|
|
|
var touchYRef = (0,_react_17_0_2_react.useRef)(0);
|
|
|
|
|
var elementRef = (0,_react_17_0_2_react.useRef)(null);
|
|
|
|
|
|
|
|
|
|
// Smooth scroll
|
|
|
|
|
var intervalRef = (0,_react_17_0_2_react.useRef)(null);
|
|
|
|
|
|
|
|
|
|
/* eslint-disable prefer-const */
|
|
|
|
|
var cleanUpEvents;
|
|
|
|
|
var onTouchMove = function onTouchMove(e) {
|
|
|
|
|
if (touchedRef.current) {
|
|
|
|
|
var currentY = Math.ceil(e.touches[0].pageY);
|
|
|
|
|
var offsetY = touchYRef.current - currentY;
|
|
|
|
|
var _offsetY = touchYRef.current - currentY;
|
|
|
|
|
touchYRef.current = currentY;
|
|
|
|
|
if (callback(offsetY)) {
|
|
|
|
|
if (callback(_offsetY)) {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Smooth interval
|
|
|
|
|
clearInterval(intervalRef.current);
|
|
|
|
|
intervalRef.current = setInterval(function () {
|
|
|
|
|
offsetY *= SMOOTH_PTG;
|
|
|
|
|
if (!callback(offsetY, true) || Math.abs(offsetY) <= 0.1) {
|
|
|
|
|
_offsetY *= SMOOTH_PTG;
|
|
|
|
|
if (!callback(_offsetY, true) || Math.abs(_offsetY) <= 0.1) {
|
|
|
|
|
clearInterval(intervalRef.current);
|
|
|
|
|
}
|
|
|
|
|
}, 16);
|
|
|
|
|
@ -861,26 +897,26 @@ function useMobileTouchMove(inVirtual, listRef, callback) {
|
|
|
|
|
}
|
|
|
|
|
return function () {
|
|
|
|
|
var _listRef$current;
|
|
|
|
|
(_listRef$current = listRef.current) === null || _listRef$current === void 0 ? void 0 : _listRef$current.removeEventListener('touchstart', onTouchStart);
|
|
|
|
|
(_listRef$current = listRef.current) === null || _listRef$current === void 0 || _listRef$current.removeEventListener('touchstart', onTouchStart);
|
|
|
|
|
cleanUpEvents();
|
|
|
|
|
clearInterval(intervalRef.current);
|
|
|
|
|
};
|
|
|
|
|
}, [inVirtual]);
|
|
|
|
|
}
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-virtual-list@3.11.3@rc-virtual-list/es/utils/scrollbarUtil.js
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-virtual-list@3.11.4@rc-virtual-list/es/utils/scrollbarUtil.js
|
|
|
|
|
var MIN_SIZE = 20;
|
|
|
|
|
function getSpinSize() {
|
|
|
|
|
var containerSize = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
|
|
|
var scrollRange = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
|
|
|
var baseSize = containerSize / scrollRange * 100;
|
|
|
|
|
var baseSize = containerSize / scrollRange * containerSize;
|
|
|
|
|
if (isNaN(baseSize)) {
|
|
|
|
|
baseSize = 0;
|
|
|
|
|
}
|
|
|
|
|
baseSize = Math.max(baseSize, MIN_SIZE);
|
|
|
|
|
baseSize = Math.min(baseSize, containerSize / 2);
|
|
|
|
|
return Math.floor(baseSize);
|
|
|
|
|
}
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-virtual-list@3.11.3@rc-virtual-list/es/hooks/useGetSize.js
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-virtual-list@3.11.4@rc-virtual-list/es/hooks/useGetSize.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ -899,6 +935,7 @@ function useGetSize(mergedData, getKey, heights, itemHeight) {
|
|
|
|
|
// Get from cache first
|
|
|
|
|
var startIndex = key2Index.get(startKey);
|
|
|
|
|
var endIndex = key2Index.get(endKey);
|
|
|
|
|
|
|
|
|
|
// Loop to fill the cache
|
|
|
|
|
if (startIndex === undefined || endIndex === undefined) {
|
|
|
|
|
var dataLen = mergedData.length;
|
|
|
|
|
@ -927,7 +964,7 @@ function useGetSize(mergedData, getKey, heights, itemHeight) {
|
|
|
|
|
};
|
|
|
|
|
return getSize;
|
|
|
|
|
}
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-virtual-list@3.11.3@rc-virtual-list/es/List.js
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-virtual-list@3.11.4@rc-virtual-list/es/List.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -982,6 +1019,7 @@ function RawList(props, ref) {
|
|
|
|
|
extraRender = props.extraRender,
|
|
|
|
|
styles = props.styles,
|
|
|
|
|
restProps = (0,objectWithoutProperties/* default */.Z)(props, _excluded);
|
|
|
|
|
|
|
|
|
|
// ================================= MISC =================================
|
|
|
|
|
var useVirtual = !!(virtual !== false && height && itemHeight);
|
|
|
|
|
var inVirtual = useVirtual && data && (itemHeight * data.length > height || !!scrollWidth);
|
|
|
|
|
@ -990,7 +1028,9 @@ function RawList(props, ref) {
|
|
|
|
|
var mergedData = data || EMPTY_DATA;
|
|
|
|
|
var componentRef = (0,_react_17_0_2_react.useRef)();
|
|
|
|
|
var fillerInnerRef = (0,_react_17_0_2_react.useRef)();
|
|
|
|
|
|
|
|
|
|
// =============================== Item Key ===============================
|
|
|
|
|
|
|
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(0),
|
|
|
|
|
_useState2 = (0,slicedToArray/* default */.Z)(_useState, 2),
|
|
|
|
|
offsetTop = _useState2[0],
|
|
|
|
|
@ -1009,6 +1049,7 @@ function RawList(props, ref) {
|
|
|
|
|
var onScrollbarStopMove = function onScrollbarStopMove() {
|
|
|
|
|
setScrollMoving(false);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// =============================== Item Key ===============================
|
|
|
|
|
var getKey = _react_17_0_2_react.useCallback(function (item) {
|
|
|
|
|
if (typeof itemKey === 'function') {
|
|
|
|
|
@ -1019,6 +1060,7 @@ function RawList(props, ref) {
|
|
|
|
|
var sharedConfig = {
|
|
|
|
|
getKey: getKey
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// ================================ Scroll ================================
|
|
|
|
|
function syncScrollTop(newTop) {
|
|
|
|
|
setOffsetTop(function (origin) {
|
|
|
|
|
@ -1033,6 +1075,7 @@ function RawList(props, ref) {
|
|
|
|
|
return alignedTop;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ================================ Legacy ================================
|
|
|
|
|
// Put ref here since the range is generate by follow
|
|
|
|
|
var rangeRef = (0,_react_17_0_2_react.useRef)({
|
|
|
|
|
@ -1044,6 +1087,7 @@ function RawList(props, ref) {
|
|
|
|
|
_useDiffItem2 = (0,slicedToArray/* default */.Z)(_useDiffItem, 1),
|
|
|
|
|
diffItem = _useDiffItem2[0];
|
|
|
|
|
diffItemRef.current = diffItem;
|
|
|
|
|
|
|
|
|
|
// ================================ Height ================================
|
|
|
|
|
var _useHeights = useHeights(getKey, null, null),
|
|
|
|
|
_useHeights2 = (0,slicedToArray/* default */.Z)(_useHeights, 4),
|
|
|
|
|
@ -1051,6 +1095,7 @@ function RawList(props, ref) {
|
|
|
|
|
collectHeight = _useHeights2[1],
|
|
|
|
|
heights = _useHeights2[2],
|
|
|
|
|
heightUpdatedMark = _useHeights2[3];
|
|
|
|
|
|
|
|
|
|
// ========================== Visible Calculation =========================
|
|
|
|
|
var _React$useMemo = _react_17_0_2_react.useMemo(function () {
|
|
|
|
|
if (!useVirtual) {
|
|
|
|
|
@ -1061,6 +1106,7 @@ function RawList(props, ref) {
|
|
|
|
|
offset: undefined
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Always use virtual scroll bar in avoid shaking
|
|
|
|
|
if (!inVirtual) {
|
|
|
|
|
var _fillerInnerRef$curre;
|
|
|
|
|
@ -1077,21 +1123,24 @@ function RawList(props, ref) {
|
|
|
|
|
var endIndex;
|
|
|
|
|
var dataLen = mergedData.length;
|
|
|
|
|
for (var i = 0; i < dataLen; i += 1) {
|
|
|
|
|
var item = mergedData[i];
|
|
|
|
|
var key = getKey(item);
|
|
|
|
|
var _item = mergedData[i];
|
|
|
|
|
var key = getKey(_item);
|
|
|
|
|
var cacheHeight = heights.get(key);
|
|
|
|
|
var currentItemBottom = itemTop + (cacheHeight === undefined ? itemHeight : cacheHeight);
|
|
|
|
|
|
|
|
|
|
// Check item top in the range
|
|
|
|
|
if (currentItemBottom >= offsetTop && startIndex === undefined) {
|
|
|
|
|
startIndex = i;
|
|
|
|
|
startOffset = itemTop;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Check item bottom in the range. We will render additional one item for motion usage
|
|
|
|
|
if (currentItemBottom > offsetTop + height && endIndex === undefined) {
|
|
|
|
|
endIndex = i;
|
|
|
|
|
}
|
|
|
|
|
itemTop = currentItemBottom;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// When scrollTop at the end but data cut to small count will reach this
|
|
|
|
|
if (startIndex === undefined) {
|
|
|
|
|
startIndex = 0;
|
|
|
|
|
@ -1101,6 +1150,7 @@ function RawList(props, ref) {
|
|
|
|
|
if (endIndex === undefined) {
|
|
|
|
|
endIndex = mergedData.length - 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Give cache to improve scroll experience
|
|
|
|
|
endIndex = Math.min(endIndex + 1, mergedData.length - 1);
|
|
|
|
|
return {
|
|
|
|
|
@ -1116,6 +1166,7 @@ function RawList(props, ref) {
|
|
|
|
|
fillerOffset = _React$useMemo.offset;
|
|
|
|
|
rangeRef.current.start = start;
|
|
|
|
|
rangeRef.current.end = end;
|
|
|
|
|
|
|
|
|
|
// ================================= Size =================================
|
|
|
|
|
var _React$useState = _react_17_0_2_react.useState({
|
|
|
|
|
width: 0,
|
|
|
|
|
@ -1130,6 +1181,7 @@ function RawList(props, ref) {
|
|
|
|
|
height: sizeInfo.height || sizeInfo.offsetHeight
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Hack on scrollbar to enable flash call
|
|
|
|
|
var verticalScrollBarRef = (0,_react_17_0_2_react.useRef)();
|
|
|
|
|
var horizontalScrollBarRef = (0,_react_17_0_2_react.useRef)();
|
|
|
|
|
@ -1139,6 +1191,7 @@ function RawList(props, ref) {
|
|
|
|
|
var verticalScrollBarSpinSize = _react_17_0_2_react.useMemo(function () {
|
|
|
|
|
return getSpinSize(size.height, scrollHeight);
|
|
|
|
|
}, [size.height, scrollHeight]);
|
|
|
|
|
|
|
|
|
|
// =============================== In Range ===============================
|
|
|
|
|
var maxScrollHeight = scrollHeight - height;
|
|
|
|
|
var maxScrollHeightRef = (0,_react_17_0_2_react.useRef)(maxScrollHeight);
|
|
|
|
|
@ -1154,6 +1207,7 @@ function RawList(props, ref) {
|
|
|
|
|
var isScrollAtTop = offsetTop <= 0;
|
|
|
|
|
var isScrollAtBottom = offsetTop >= maxScrollHeight;
|
|
|
|
|
var originScroll = useOriginScroll(isScrollAtTop, isScrollAtBottom);
|
|
|
|
|
|
|
|
|
|
// ================================ Scroll ================================
|
|
|
|
|
var getVirtualScrollInfo = function getVirtualScrollInfo() {
|
|
|
|
|
return {
|
|
|
|
|
@ -1165,6 +1219,7 @@ function RawList(props, ref) {
|
|
|
|
|
var triggerScroll = (0,_rc_util_5_38_1_rc_util_es.useEvent)(function () {
|
|
|
|
|
if (onVirtualScroll) {
|
|
|
|
|
var nextInfo = getVirtualScrollInfo();
|
|
|
|
|
|
|
|
|
|
// Trigger when offset changed
|
|
|
|
|
if (lastVirtualScrollInfoRef.current.x !== nextInfo.x || lastVirtualScrollInfoRef.current.y !== nextInfo.y) {
|
|
|
|
|
onVirtualScroll(nextInfo);
|
|
|
|
|
@ -1183,14 +1238,16 @@ function RawList(props, ref) {
|
|
|
|
|
syncScrollTop(newOffset);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// When data size reduce. It may trigger native scroll event back to fit scroll position
|
|
|
|
|
function onFallbackScroll(e) {
|
|
|
|
|
var newScrollTop = e.currentTarget.scrollTop;
|
|
|
|
|
if (newScrollTop !== offsetTop) {
|
|
|
|
|
syncScrollTop(newScrollTop);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Trigger origin onScroll
|
|
|
|
|
onScroll === null || onScroll === void 0 ? void 0 : onScroll(e);
|
|
|
|
|
onScroll === null || onScroll === void 0 || onScroll(e);
|
|
|
|
|
triggerScroll();
|
|
|
|
|
}
|
|
|
|
|
var keepInHorizontalRange = function keepInHorizontalRange(nextOffsetLeft) {
|
|
|
|
|
@ -1203,6 +1260,7 @@ function RawList(props, ref) {
|
|
|
|
|
var onWheelDelta = (0,_rc_util_5_38_1_rc_util_es.useEvent)(function (offsetXY, fromHorizontal) {
|
|
|
|
|
if (fromHorizontal) {
|
|
|
|
|
// Horizontal scroll no need sync virtual position
|
|
|
|
|
|
|
|
|
|
(0,_react_dom_17_0_2_react_dom.flushSync)(function () {
|
|
|
|
|
setOffsetLeft(function (left) {
|
|
|
|
|
var nextOffsetLeft = left + (isRTL ? -offsetXY : offsetXY);
|
|
|
|
|
@ -1217,11 +1275,13 @@ function RawList(props, ref) {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Since this added in global,should use ref to keep update
|
|
|
|
|
var _useFrameWheel = useFrameWheel(useVirtual, isScrollAtTop, isScrollAtBottom, !!scrollWidth, onWheelDelta),
|
|
|
|
|
_useFrameWheel2 = (0,slicedToArray/* default */.Z)(_useFrameWheel, 2),
|
|
|
|
|
onRawWheel = _useFrameWheel2[0],
|
|
|
|
|
onFireFoxScroll = _useFrameWheel2[1];
|
|
|
|
|
|
|
|
|
|
// Mobile touch move
|
|
|
|
|
useMobileTouchMove(useVirtual, componentRef, function (deltaY, smoothOffset) {
|
|
|
|
|
if (originScroll(deltaY, smoothOffset)) {
|
|
|
|
|
@ -1250,6 +1310,7 @@ function RawList(props, ref) {
|
|
|
|
|
componentEle.removeEventListener('MozMousePixelScroll', onMozMousePixelScroll);
|
|
|
|
|
};
|
|
|
|
|
}, [useVirtual]);
|
|
|
|
|
|
|
|
|
|
// Sync scroll left
|
|
|
|
|
(0,useLayoutEffect/* default */.Z)(function () {
|
|
|
|
|
if (scrollWidth) {
|
|
|
|
|
@ -1258,11 +1319,12 @@ function RawList(props, ref) {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}, [size.width, scrollWidth]);
|
|
|
|
|
|
|
|
|
|
// ================================= Ref ==================================
|
|
|
|
|
var delayHideScrollBar = function delayHideScrollBar() {
|
|
|
|
|
var _verticalScrollBarRef, _horizontalScrollBarR;
|
|
|
|
|
(_verticalScrollBarRef = verticalScrollBarRef.current) === null || _verticalScrollBarRef === void 0 ? void 0 : _verticalScrollBarRef.delayHidden();
|
|
|
|
|
(_horizontalScrollBarR = horizontalScrollBarRef.current) === null || _horizontalScrollBarR === void 0 ? void 0 : _horizontalScrollBarR.delayHidden();
|
|
|
|
|
(_verticalScrollBarRef = verticalScrollBarRef.current) === null || _verticalScrollBarRef === void 0 || _verticalScrollBarRef.delayHidden();
|
|
|
|
|
(_horizontalScrollBarR = horizontalScrollBarRef.current) === null || _horizontalScrollBarR === void 0 || _horizontalScrollBarR.delayHidden();
|
|
|
|
|
};
|
|
|
|
|
var _scrollTo = useScrollTo(componentRef, mergedData, heights, itemHeight, getKey, function () {
|
|
|
|
|
return collectHeight(true);
|
|
|
|
|
@ -1279,6 +1341,7 @@ function RawList(props, ref) {
|
|
|
|
|
if (config.left !== undefined) {
|
|
|
|
|
setOffsetLeft(keepInHorizontalRange(config.left));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Scroll Y
|
|
|
|
|
_scrollTo(config.top);
|
|
|
|
|
} else {
|
|
|
|
|
@ -1287,6 +1350,7 @@ function RawList(props, ref) {
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// ================================ Effect ================================
|
|
|
|
|
/** We need told outside that some list not rendered */
|
|
|
|
|
(0,useLayoutEffect/* default */.Z)(function () {
|
|
|
|
|
@ -1295,6 +1359,7 @@ function RawList(props, ref) {
|
|
|
|
|
onVisibleChange(renderList, mergedData);
|
|
|
|
|
}
|
|
|
|
|
}, [start, end, mergedData]);
|
|
|
|
|
|
|
|
|
|
// ================================ Extra =================================
|
|
|
|
|
var getSize = useGetSize(mergedData, getKey, heights, itemHeight);
|
|
|
|
|
var extraContent = extraRender === null || extraRender === void 0 ? void 0 : extraRender({
|
|
|
|
|
@ -1306,6 +1371,7 @@ function RawList(props, ref) {
|
|
|
|
|
rtl: isRTL,
|
|
|
|
|
getSize: getSize
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// ================================ Render ================================
|
|
|
|
|
var listChildren = useChildren(mergedData, start, end, scrollWidth, setInstanceRef, children, sharedConfig);
|
|
|
|
|
var componentStyle = null;
|
|
|
|
|
@ -1362,7 +1428,7 @@ function RawList(props, ref) {
|
|
|
|
|
containerSize: size.height,
|
|
|
|
|
style: styles === null || styles === void 0 ? void 0 : styles.verticalScrollBar,
|
|
|
|
|
thumbStyle: styles === null || styles === void 0 ? void 0 : styles.verticalScrollBarThumb
|
|
|
|
|
}), inVirtual && scrollWidth && /*#__PURE__*/_react_17_0_2_react.createElement(es_ScrollBar, {
|
|
|
|
|
}), inVirtual && scrollWidth > size.width && /*#__PURE__*/_react_17_0_2_react.createElement(es_ScrollBar, {
|
|
|
|
|
ref: horizontalScrollBarRef,
|
|
|
|
|
prefixCls: prefixCls,
|
|
|
|
|
scrollOffset: offsetLeft,
|
|
|
|
|
@ -1381,9 +1447,9 @@ function RawList(props, ref) {
|
|
|
|
|
var List = /*#__PURE__*/_react_17_0_2_react.forwardRef(RawList);
|
|
|
|
|
List.displayName = 'List';
|
|
|
|
|
/* harmony default export */ var es_List = (List);
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-virtual-list@3.11.3@rc-virtual-list/es/index.js
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-virtual-list@3.11.4@rc-virtual-list/es/index.js
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ var _rc_virtual_list_3_11_3_rc_virtual_list_es = (es_List);
|
|
|
|
|
/* harmony default export */ var _rc_virtual_list_3_11_4_rc_virtual_list_es = (es_List);
|
|
|
|
|
|
|
|
|
|
/***/ })
|
|
|
|
|
|