@jetbrains/ring-ui 6.0.22 → 6.0.24
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 +4 -0
- package/components/list/list.d.ts +2 -0
- package/components/list/list.js +3 -2
- package/components/radio/radio.css +3 -3
- package/components/select/select-popup.css +0 -4
- package/components/select/select__popup.js +1 -3
- package/components/toggle/toggle.css +5 -5
- package/package.json +1 -1
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}
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
|
|
41
41
|
&::after {
|
|
42
42
|
position: absolute;
|
|
43
|
-
top:
|
|
43
|
+
top: 50%;
|
|
44
44
|
left: 3px;
|
|
45
45
|
|
|
46
46
|
width: var(--ring-unit);
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
|
|
51
51
|
transition: opacity var(--ring-fast-ease), transform var(--ring-fast-ease);
|
|
52
52
|
|
|
53
|
-
transform: scale(0);
|
|
53
|
+
transform: scale(0) translateY(-50%);
|
|
54
54
|
|
|
55
55
|
opacity: 0;
|
|
56
56
|
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
&::after {
|
|
85
85
|
transition: none;
|
|
86
86
|
|
|
87
|
-
transform: scale(1);
|
|
87
|
+
transform: scale(1) translateY(-50%);
|
|
88
88
|
|
|
89
89
|
opacity: 1;
|
|
90
90
|
}
|
|
@@ -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
|
}
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
|
|
73
73
|
&::before {
|
|
74
74
|
position: absolute;
|
|
75
|
-
top:
|
|
75
|
+
top: 50%;
|
|
76
76
|
left: -1px;
|
|
77
77
|
|
|
78
78
|
box-sizing: border-box;
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
|
|
85
85
|
transition: transform timing-function duration;
|
|
86
86
|
|
|
87
|
-
transform: translateX(padding);
|
|
87
|
+
transform: translateX(padding) translateY(-50%);
|
|
88
88
|
|
|
89
89
|
border: solid 1px var(--ring-switch-border-color);
|
|
90
90
|
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
|
|
123
123
|
/* stylelint-disable-next-line selector-max-specificity */
|
|
124
124
|
& .input:checked + ::before {
|
|
125
|
-
transform: translateX(calc(var(--ring-unit) * 1.5 - padding));
|
|
125
|
+
transform: translateX(calc(var(--ring-unit) * 1.5 - padding)) translateY(-50%);
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
|
|
148
148
|
/* stylelint-disable-next-line selector-max-specificity */
|
|
149
149
|
& .input:checked + ::before {
|
|
150
|
-
transform: translateX(12px);
|
|
150
|
+
transform: translateX(12px) translateY(-50%);
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
|
|
@@ -172,7 +172,7 @@
|
|
|
172
172
|
|
|
173
173
|
/* stylelint-disable-next-line selector-max-specificity */
|
|
174
174
|
& .input:checked + ::before {
|
|
175
|
-
transform: translateX(calc(var(--ring-unit) * 2 - padding));
|
|
175
|
+
transform: translateX(calc(var(--ring-unit) * 2 - padding)) translateY(-50%);
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
|