rc-virtual-list
Advanced tools
Comparing version 0.0.0-alpha.4 to 0.0.0-alpha.5
@@ -33,2 +33,6 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
import { getIndexByStartLoc, findListDiffIndex } from './utils/algorithmUtil'; | ||
var ScrollStyle = { | ||
overflowY: 'auto', | ||
overflowAnchor: 'none' | ||
}; | ||
var ITEM_SCALE_RATE = 1; | ||
@@ -438,19 +442,18 @@ /** | ||
itemKey = _this$props4.itemKey, | ||
restProps = _objectWithoutProperties(_this$props4, ["style", "component", "height", "itemHeight", "data", "children", "itemKey"]); | ||
restProps = _objectWithoutProperties(_this$props4, ["style", "component", "height", "itemHeight", "data", "children", "itemKey"]); // Render pure list if not set height or height is enough for all items | ||
var mergedStyle = _objectSpread({}, style, { | ||
height: height, | ||
overflowY: 'auto', | ||
overflowAnchor: 'none' | ||
}); // Render pure list if not set height or height is enough for all items | ||
if (height === undefined || data.length * itemHeight <= height) { | ||
return React.createElement(Component, Object.assign({ | ||
style: mergedStyle | ||
style: height ? _objectSpread({}, style, {}, ScrollStyle) : style | ||
}, restProps), React.createElement(Filler, { | ||
height: height | ||
}, this.renderChildren(data, 0, children))); | ||
} | ||
} // Use virtual list | ||
var mergedStyle = _objectSpread({}, style, { | ||
height: height | ||
}, ScrollStyle); | ||
var _this$state4 = this.state, | ||
@@ -457,0 +460,0 @@ status = _this$state4.status, |
@@ -48,2 +48,6 @@ "use strict"; | ||
var ScrollStyle = { | ||
overflowY: 'auto', | ||
overflowAnchor: 'none' | ||
}; | ||
var ITEM_SCALE_RATE = 1; | ||
@@ -453,19 +457,18 @@ /** | ||
itemKey = _this$props4.itemKey, | ||
restProps = _objectWithoutProperties(_this$props4, ["style", "component", "height", "itemHeight", "data", "children", "itemKey"]); | ||
restProps = _objectWithoutProperties(_this$props4, ["style", "component", "height", "itemHeight", "data", "children", "itemKey"]); // Render pure list if not set height or height is enough for all items | ||
var mergedStyle = _objectSpread({}, style, { | ||
height: height, | ||
overflowY: 'auto', | ||
overflowAnchor: 'none' | ||
}); // Render pure list if not set height or height is enough for all items | ||
if (height === undefined || data.length * itemHeight <= height) { | ||
return React.createElement(Component, Object.assign({ | ||
style: mergedStyle | ||
style: height ? _objectSpread({}, style, {}, ScrollStyle) : style | ||
}, restProps), React.createElement(_Filler.default, { | ||
height: height | ||
}, this.renderChildren(data, 0, children))); | ||
} | ||
} // Use virtual list | ||
var mergedStyle = _objectSpread({}, style, { | ||
height: height | ||
}, ScrollStyle); | ||
var _this$state4 = this.state, | ||
@@ -472,0 +475,0 @@ status = _this$state4.status, |
{ | ||
"name": "rc-virtual-list", | ||
"version": "0.0.0-alpha.4", | ||
"version": "0.0.0-alpha.5", | ||
"description": "React Virtual List Component", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
78946
1751