rc-virtual-list
Advanced tools
Comparing version 3.10.10 to 3.11.0
@@ -36,2 +36,8 @@ import * as React from 'react'; | ||
scrollWidth?: number; | ||
styles?: { | ||
horizontalScrollBar?: React.CSSProperties; | ||
horizontalScrollBarThumb?: React.CSSProperties; | ||
verticalScrollBar?: React.CSSProperties; | ||
verticalScrollBarThumb?: React.CSSProperties; | ||
}; | ||
onScroll?: React.UIEventHandler<HTMLElement>; | ||
@@ -38,0 +44,0 @@ /** |
@@ -7,3 +7,3 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; | ||
var _excluded = ["prefixCls", "className", "height", "itemHeight", "fullHeight", "style", "data", "children", "itemKey", "virtual", "direction", "scrollWidth", "component", "onScroll", "onVirtualScroll", "onVisibleChange", "innerProps", "extraRender"]; | ||
var _excluded = ["prefixCls", "className", "height", "itemHeight", "fullHeight", "style", "data", "children", "itemKey", "virtual", "direction", "scrollWidth", "component", "onScroll", "onVirtualScroll", "onVisibleChange", "innerProps", "extraRender", "styles"]; | ||
import * as React from 'react'; | ||
@@ -54,2 +54,3 @@ import { useRef, useState } from 'react'; | ||
extraRender = props.extraRender, | ||
styles = props.styles, | ||
restProps = _objectWithoutProperties(props, _excluded); | ||
@@ -430,3 +431,5 @@ // ================================= MISC ================================= | ||
spinSize: verticalScrollBarSpinSize, | ||
containerSize: size.height | ||
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.createElement(ScrollBar, { | ||
@@ -443,3 +446,5 @@ ref: horizontalScrollBarRef, | ||
containerSize: size.width, | ||
horizontal: true | ||
horizontal: true, | ||
style: styles === null || styles === void 0 ? void 0 : styles.horizontalScrollBar, | ||
thumbStyle: styles === null || styles === void 0 ? void 0 : styles.horizontalScrollBarThumb | ||
})); | ||
@@ -446,0 +451,0 @@ } |
@@ -12,2 +12,4 @@ import * as React from 'react'; | ||
horizontal?: boolean; | ||
style?: React.CSSProperties; | ||
thumbStyle?: React.CSSProperties; | ||
spinSize: number; | ||
@@ -14,0 +16,0 @@ containerSize: number; |
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2"; | ||
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray"; | ||
@@ -21,3 +22,5 @@ import * as React from 'react'; | ||
spinSize = props.spinSize, | ||
containerSize = props.containerSize; | ||
containerSize = props.containerSize, | ||
style = props.style, | ||
propsThumbStyle = props.thumbStyle; | ||
var _React$useState = React.useState(false), | ||
@@ -169,7 +172,7 @@ _React$useState2 = _slicedToArray(_React$useState, 2), | ||
var scrollbarPrefixCls = "".concat(prefixCls, "-scrollbar"); | ||
var containerStyle = { | ||
var containerStyle = _objectSpread({ | ||
position: 'absolute', | ||
visibility: visible && canScroll ? null : 'hidden' | ||
}; | ||
var thumbStyle = { | ||
}, style); | ||
var thumbStyle = _objectSpread({ | ||
position: 'absolute', | ||
@@ -180,3 +183,3 @@ background: 'rgba(0, 0, 0, 0.5)', | ||
userSelect: 'none' | ||
}; | ||
}, propsThumbStyle); | ||
if (horizontal) { | ||
@@ -183,0 +186,0 @@ // Container |
@@ -36,2 +36,8 @@ import * as React from 'react'; | ||
scrollWidth?: number; | ||
styles?: { | ||
horizontalScrollBar?: React.CSSProperties; | ||
horizontalScrollBarThumb?: React.CSSProperties; | ||
verticalScrollBar?: React.CSSProperties; | ||
verticalScrollBarThumb?: React.CSSProperties; | ||
}; | ||
onScroll?: React.UIEventHandler<HTMLElement>; | ||
@@ -38,0 +44,0 @@ /** |
@@ -34,3 +34,3 @@ "use strict"; | ||
var _useGetSize = require("./hooks/useGetSize"); | ||
var _excluded = ["prefixCls", "className", "height", "itemHeight", "fullHeight", "style", "data", "children", "itemKey", "virtual", "direction", "scrollWidth", "component", "onScroll", "onVirtualScroll", "onVisibleChange", "innerProps", "extraRender"]; | ||
var _excluded = ["prefixCls", "className", "height", "itemHeight", "fullHeight", "style", "data", "children", "itemKey", "virtual", "direction", "scrollWidth", "component", "onScroll", "onVirtualScroll", "onVisibleChange", "innerProps", "extraRender", "styles"]; | ||
var EMPTY_DATA = []; | ||
@@ -63,2 +63,3 @@ var ScrollStyle = { | ||
extraRender = props.extraRender, | ||
styles = props.styles, | ||
restProps = (0, _objectWithoutProperties2.default)(props, _excluded); | ||
@@ -439,3 +440,5 @@ // ================================= MISC ================================= | ||
spinSize: verticalScrollBarSpinSize, | ||
containerSize: size.height | ||
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.createElement(_ScrollBar.default, { | ||
@@ -452,3 +455,5 @@ ref: horizontalScrollBarRef, | ||
containerSize: size.width, | ||
horizontal: true | ||
horizontal: true, | ||
style: styles === null || styles === void 0 ? void 0 : styles.horizontalScrollBar, | ||
thumbStyle: styles === null || styles === void 0 ? void 0 : styles.horizontalScrollBarThumb | ||
})); | ||
@@ -455,0 +460,0 @@ } |
@@ -12,2 +12,4 @@ import * as React from 'react'; | ||
horizontal?: boolean; | ||
style?: React.CSSProperties; | ||
thumbStyle?: React.CSSProperties; | ||
spinSize: number; | ||
@@ -14,0 +16,0 @@ containerSize: number; |
@@ -10,2 +10,3 @@ "use strict"; | ||
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); | ||
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2")); | ||
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray")); | ||
@@ -30,3 +31,5 @@ var React = _interopRequireWildcard(require("react")); | ||
spinSize = props.spinSize, | ||
containerSize = props.containerSize; | ||
containerSize = props.containerSize, | ||
style = props.style, | ||
propsThumbStyle = props.thumbStyle; | ||
var _React$useState = React.useState(false), | ||
@@ -178,7 +181,7 @@ _React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2), | ||
var scrollbarPrefixCls = "".concat(prefixCls, "-scrollbar"); | ||
var containerStyle = { | ||
var containerStyle = (0, _objectSpread2.default)({ | ||
position: 'absolute', | ||
visibility: visible && canScroll ? null : 'hidden' | ||
}; | ||
var thumbStyle = { | ||
}, style); | ||
var thumbStyle = (0, _objectSpread2.default)({ | ||
position: 'absolute', | ||
@@ -189,3 +192,3 @@ background: 'rgba(0, 0, 0, 0.5)', | ||
userSelect: 'none' | ||
}; | ||
}, propsThumbStyle); | ||
if (horizontal) { | ||
@@ -192,0 +195,0 @@ // Container |
{ | ||
"name": "rc-virtual-list", | ||
"version": "3.10.10", | ||
"version": "3.11.0", | ||
"description": "React Virtual List Component", | ||
@@ -5,0 +5,0 @@ "engines": { |
@@ -54,13 +54,14 @@ # rc-virtual-list | ||
| Prop | Description | Type | Default | | ||
| ---------- | ------------------------------------------------------- | ------------------------------------ | ------- | | ||
| children | Render props of item | (item, index, props) => ReactElement | - | | ||
| component | Customize List dom element | string \| Component | div | | ||
| data | Data list | Array | - | | ||
| disabled | Disable scroll check. Usually used on animation control | boolean | false | | ||
| height | List height | number | - | | ||
| itemHeight | Item minium height | number | - | | ||
| itemKey | Match key with item | string | - | | ||
| Prop | Description | Type | Default | | ||
| ---------- | ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | | ||
| children | Render props of item | (item, index, props) => ReactElement | - | | ||
| component | Customize List dom element | string \| Component | div | | ||
| data | Data list | Array | - | | ||
| disabled | Disable scroll check. Usually used on animation control | boolean | false | | ||
| height | List height | number | - | | ||
| itemHeight | Item minium height | number | - | | ||
| itemKey | Match key with item | string | - | | ||
| styles | style | { horizontalScrollBar?: React.CSSProperties; horizontalScrollBarThumb?: React.CSSProperties; verticalScrollBar?: React.CSSProperties; verticalScrollBarThumb?: React.CSSProperties; } | - | | ||
`children` provides additional `props` argument to support IE 11 scroll shaking. | ||
It will set `style` to `visibility: hidden` when measuring. You can ignore this if no requirement on IE. |
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
128649
3222
67