@jetbrains/ring-ui 6.0.22 → 6.0.23
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/components/list/list.css
CHANGED
|
@@ -45,6 +45,7 @@ export interface ListProps<T = unknown> {
|
|
|
45
45
|
compact?: boolean | null | undefined;
|
|
46
46
|
disableScrollToActive?: boolean | null | undefined;
|
|
47
47
|
hidden?: boolean | null | undefined;
|
|
48
|
+
preventListOverscroll?: boolean | undefined;
|
|
48
49
|
}
|
|
49
50
|
export declare const ActiveItemContext: {
|
|
50
51
|
ValueContext: React.Context<string | undefined>;
|
|
@@ -114,6 +115,7 @@ export default class List<T = unknown> extends Component<ListProps<T>, ListState
|
|
|
114
115
|
disableScrollToActive: PropTypes.Requireable<boolean>;
|
|
115
116
|
hidden: PropTypes.Requireable<boolean>;
|
|
116
117
|
ariaLabel: PropTypes.Requireable<string>;
|
|
118
|
+
preventListOverscroll: PropTypes.Requireable<boolean>;
|
|
117
119
|
};
|
|
118
120
|
static defaultProps: {
|
|
119
121
|
data: never[];
|
package/components/list/list.js
CHANGED
|
@@ -86,7 +86,8 @@ export default class List extends Component {
|
|
|
86
86
|
compact: PropTypes.bool,
|
|
87
87
|
disableScrollToActive: PropTypes.bool,
|
|
88
88
|
hidden: PropTypes.bool,
|
|
89
|
-
ariaLabel: PropTypes.string
|
|
89
|
+
ariaLabel: PropTypes.string,
|
|
90
|
+
preventListOverscroll: PropTypes.bool
|
|
90
91
|
};
|
|
91
92
|
static defaultProps = {
|
|
92
93
|
data: [],
|
|
@@ -515,7 +516,7 @@ export default class List extends Component {
|
|
|
515
516
|
const dirOverride = { direction: 'inherit' }; // Virtualized sets "direction: ltr" by default https://github.com/bvaughn/react-virtualized/issues/457
|
|
516
517
|
return (<AutoSizer disableHeight onResize={this.props.onResize}>
|
|
517
518
|
{({ width }) => (<div ref={registerChild}>
|
|
518
|
-
<VirtualizedList aria-label={this.props.ariaLabel} ref={this.virtualizedListRef} className=
|
|
519
|
+
<VirtualizedList aria-label={this.props.ariaLabel} ref={this.virtualizedListRef} className={classNames('ring-list__i', { [styles.overscrollNone]: this.props.preventListOverscroll })} autoHeight={autoHeight} style={maxHeight ? { maxHeight, height: 'auto', ...dirOverride } : dirOverride} autoContainerWidth height={height} width={width} isScrolling={isScrolling} onScroll={e => {
|
|
519
520
|
onChildScroll(e);
|
|
520
521
|
this.scrollEndHandler();
|
|
521
522
|
}} scrollTop={scrollTop} rowCount={rowCount} estimatedRowSize={this.defaultItemHeight()} rowHeight={this._cache.rowHeight} rowRenderer={this.renderItem} overscanRowCount={this._bufferSize}
|
|
@@ -252,9 +252,7 @@ export default class SelectPopup extends PureComponent {
|
|
|
252
252
|
if (this.props.toolbar) {
|
|
253
253
|
maxHeight -= TOOLBAR_HEIGHT;
|
|
254
254
|
}
|
|
255
|
-
return (<List id={this.props.listId} maxHeight={maxHeight} data={this.props.data} activeIndex={this.props.activeIndex} ref={this.listRef} restoreActiveIndex activateFirstItem onSelect={this.onListSelect} onResize={this.handleListResize} onScrollToBottom={this.props.onLoadMore} hidden={this.props.hidden} shortcuts={!this.props.hidden} disableMoveOverflow={this.props.disableMoveOverflow} disableMoveDownOverflow={this.props.loading} disableScrollToActive={this.props.disableScrollToActive} compact={this.props.compact}
|
|
256
|
-
? styles.popupOverscrollNone
|
|
257
|
-
: undefined} renderOptimization={this.props.renderOptimization}/>);
|
|
255
|
+
return (<List id={this.props.listId} maxHeight={maxHeight} data={this.props.data} activeIndex={this.props.activeIndex} ref={this.listRef} restoreActiveIndex activateFirstItem onSelect={this.onListSelect} onResize={this.handleListResize} onScrollToBottom={this.props.onLoadMore} hidden={this.props.hidden} shortcuts={!this.props.hidden} disableMoveOverflow={this.props.disableMoveOverflow} disableMoveDownOverflow={this.props.loading} disableScrollToActive={this.props.disableScrollToActive} compact={this.props.compact} preventListOverscroll={this.props.preventListOverscroll} renderOptimization={this.props.renderOptimization}/>);
|
|
258
256
|
}
|
|
259
257
|
return null;
|
|
260
258
|
}
|