rc-virtual-list
Advanced tools
Comparing version 0.0.0-alpha.9 to 0.0.0-alpha.10
@@ -26,3 +26,3 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { keys.push.apply(keys, Object.getOwnPropertySymbols(object)); } if (enumerableOnly) keys = keys.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); return keys; } | ||
position: 'relative', | ||
overflow: 'visible' | ||
overflow: 'hidden' | ||
}; | ||
@@ -29,0 +29,0 @@ innerStyle = _objectSpread({}, innerStyle, { |
@@ -49,2 +49,6 @@ import * as React from 'react'; | ||
cacheScroll?: RelativeScroll; | ||
/** | ||
* Cache `data.length` to use for `disabled` status. | ||
*/ | ||
itemCount: number; | ||
} | ||
@@ -94,2 +98,5 @@ /** | ||
constructor(props: ListProps<T>); | ||
static getDerivedStateFromProps(nextProps: ListProps<any>): { | ||
itemCount: number; | ||
}; | ||
/** | ||
@@ -96,0 +103,0 @@ * Phase 1: Initial should sync with default scroll top |
@@ -205,13 +205,14 @@ 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); } | ||
startItemTop: 0, | ||
isVirtual: requireVirtual(props.height, props.itemHeight, props.data.length) | ||
isVirtual: requireVirtual(props.height, props.itemHeight, props.data.length), | ||
itemCount: props.data.length | ||
}; | ||
return _this; | ||
} | ||
/** | ||
* Phase 1: Initial should sync with default scroll top | ||
*/ | ||
_createClass(List, [{ | ||
key: "componentDidMount", | ||
/** | ||
* Phase 1: Initial should sync with default scroll top | ||
*/ | ||
value: function componentDidMount() { | ||
@@ -517,3 +518,5 @@ if (this.listRef.current) { | ||
value: function render() { | ||
var isVirtual = this.state.isVirtual; | ||
var _this$state5 = this.state, | ||
isVirtual = _this$state5.isVirtual, | ||
itemCount = _this$state5.itemCount; | ||
@@ -551,8 +554,8 @@ var _this$props4 = this.props, | ||
var _this$state5 = this.state, | ||
status = _this$state5.status, | ||
startIndex = _this$state5.startIndex, | ||
endIndex = _this$state5.endIndex, | ||
startItemTop = _this$state5.startItemTop; | ||
var contentHeight = data.length * itemHeight * ITEM_SCALE_RATE; | ||
var _this$state6 = this.state, | ||
status = _this$state6.status, | ||
startIndex = _this$state6.startIndex, | ||
endIndex = _this$state6.endIndex, | ||
startItemTop = _this$state6.startItemTop; | ||
var contentHeight = itemCount * itemHeight * ITEM_SCALE_RATE; | ||
return React.createElement(Component, Object.assign({ | ||
@@ -568,2 +571,13 @@ style: mergedStyle | ||
} | ||
}], [{ | ||
key: "getDerivedStateFromProps", | ||
value: function getDerivedStateFromProps(nextProps) { | ||
if (!nextProps.disabled) { | ||
return { | ||
itemCount: nextProps.data.length | ||
}; | ||
} | ||
return null; | ||
} | ||
}]); | ||
@@ -570,0 +584,0 @@ |
@@ -35,3 +35,3 @@ "use strict"; | ||
position: 'relative', | ||
overflow: 'visible' | ||
overflow: 'hidden' | ||
}; | ||
@@ -38,0 +38,0 @@ innerStyle = _objectSpread({}, innerStyle, { |
@@ -49,2 +49,6 @@ import * as React from 'react'; | ||
cacheScroll?: RelativeScroll; | ||
/** | ||
* Cache `data.length` to use for `disabled` status. | ||
*/ | ||
itemCount: number; | ||
} | ||
@@ -94,2 +98,5 @@ /** | ||
constructor(props: ListProps<T>); | ||
static getDerivedStateFromProps(nextProps: ListProps<any>): { | ||
itemCount: number; | ||
}; | ||
/** | ||
@@ -96,0 +103,0 @@ * Phase 1: Initial should sync with default scroll top |
@@ -220,13 +220,14 @@ "use strict"; | ||
startItemTop: 0, | ||
isVirtual: (0, _itemUtil.requireVirtual)(props.height, props.itemHeight, props.data.length) | ||
isVirtual: (0, _itemUtil.requireVirtual)(props.height, props.itemHeight, props.data.length), | ||
itemCount: props.data.length | ||
}; | ||
return _this; | ||
} | ||
/** | ||
* Phase 1: Initial should sync with default scroll top | ||
*/ | ||
_createClass(List, [{ | ||
key: "componentDidMount", | ||
/** | ||
* Phase 1: Initial should sync with default scroll top | ||
*/ | ||
value: function componentDidMount() { | ||
@@ -532,3 +533,5 @@ if (this.listRef.current) { | ||
value: function render() { | ||
var isVirtual = this.state.isVirtual; | ||
var _this$state5 = this.state, | ||
isVirtual = _this$state5.isVirtual, | ||
itemCount = _this$state5.itemCount; | ||
@@ -566,8 +569,8 @@ var _this$props4 = this.props, | ||
var _this$state5 = this.state, | ||
status = _this$state5.status, | ||
startIndex = _this$state5.startIndex, | ||
endIndex = _this$state5.endIndex, | ||
startItemTop = _this$state5.startItemTop; | ||
var contentHeight = data.length * itemHeight * ITEM_SCALE_RATE; | ||
var _this$state6 = this.state, | ||
status = _this$state6.status, | ||
startIndex = _this$state6.startIndex, | ||
endIndex = _this$state6.endIndex, | ||
startItemTop = _this$state6.startItemTop; | ||
var contentHeight = itemCount * itemHeight * ITEM_SCALE_RATE; | ||
return React.createElement(Component, Object.assign({ | ||
@@ -583,2 +586,13 @@ style: mergedStyle | ||
} | ||
}], [{ | ||
key: "getDerivedStateFromProps", | ||
value: function getDerivedStateFromProps(nextProps) { | ||
if (!nextProps.disabled) { | ||
return { | ||
itemCount: nextProps.data.length | ||
}; | ||
} | ||
return null; | ||
} | ||
}]); | ||
@@ -585,0 +599,0 @@ |
{ | ||
"name": "rc-virtual-list", | ||
"version": "0.0.0-alpha.9", | ||
"version": "0.0.0-alpha.10", | ||
"description": "React Virtual List Component", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
87320
1982