u
This commit is contained in:
@@ -21,6 +21,7 @@ import { alpha } from '@mui/material/styles';
|
|||||||
* @prop {number} [unfilteredCount] - Alias for totalCount.
|
* @prop {number} [unfilteredCount] - Alias for totalCount.
|
||||||
* @prop {(page: number) => void} [onPageChange] - Called on page change.
|
* @prop {(page: number) => void} [onPageChange] - Called on page change.
|
||||||
* @prop {boolean} [virtualScrollbar=false] - Shows a synchronized scrollbar alongside pagination controls.
|
* @prop {boolean} [virtualScrollbar=false] - Shows a synchronized scrollbar alongside pagination controls.
|
||||||
|
* @prop {boolean} [reserveScrollbar] - Reserves raceway space even when items do not overflow (defaults to true when virtualScrollbar is true).
|
||||||
* @prop {boolean} [debug=false] - Dashed outline for layout debugging.
|
* @prop {boolean} [debug=false] - Dashed outline for layout debugging.
|
||||||
* @prop {object} [sx] - Extra styles.
|
* @prop {object} [sx] - Extra styles.
|
||||||
*/
|
*/
|
||||||
@@ -411,6 +412,7 @@ class FillSpace extends Component {
|
|||||||
onPageChange,
|
onPageChange,
|
||||||
onWheel,
|
onWheel,
|
||||||
virtualScrollbar = false,
|
virtualScrollbar = false,
|
||||||
|
reserveScrollbar,
|
||||||
racewayMarginBottom,
|
racewayMarginBottom,
|
||||||
racewayRight,
|
racewayRight,
|
||||||
debug = false,
|
debug = false,
|
||||||
@@ -443,6 +445,10 @@ class FillSpace extends Component {
|
|||||||
|
|
||||||
const racewayBottom = Math.max(0, Number(racewayMarginBottom ?? RACEWAY_BOTTOM_MARGIN) || 0);
|
const racewayBottom = Math.max(0, Number(racewayMarginBottom ?? RACEWAY_BOTTOM_MARGIN) || 0);
|
||||||
const racewayRightOffset = racewayRight != null ? racewayRight : 0;
|
const racewayRightOffset = racewayRight != null ? racewayRight : 0;
|
||||||
|
const scrollbarReserved = reserveScrollbar ?? Boolean(virtualScrollbar);
|
||||||
|
const scrollbarPadding = scrollbarReserved
|
||||||
|
? `${Math.max(0, RACEWAY_WIDTH + racewayRightOffset + 8)}px`
|
||||||
|
: 0;
|
||||||
|
|
||||||
let thumbHeight = 0;
|
let thumbHeight = 0;
|
||||||
let thumbTop = 0;
|
let thumbTop = 0;
|
||||||
@@ -514,7 +520,17 @@ class FillSpace extends Component {
|
|||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
) : null}
|
) : null}
|
||||||
|
{header != null ? (
|
||||||
|
<Box
|
||||||
|
sx={{
|
||||||
|
width: '100%',
|
||||||
|
pr: scrollbarPadding,
|
||||||
|
boxSizing: 'border-box',
|
||||||
|
}}
|
||||||
|
>
|
||||||
{header}
|
{header}
|
||||||
|
</Box>
|
||||||
|
) : null}
|
||||||
<Box
|
<Box
|
||||||
ref={(el) => {
|
ref={(el) => {
|
||||||
this.ref = el;
|
this.ref = el;
|
||||||
@@ -545,7 +561,7 @@ class FillSpace extends Component {
|
|||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
width: '100%',
|
width: '100%',
|
||||||
pr: canScroll ? `${Math.max(0, RACEWAY_WIDTH + racewayRightOffset + 8)}px` : 0,
|
pr: scrollbarPadding,
|
||||||
boxSizing: 'border-box',
|
boxSizing: 'border-box',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user