mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed linter error.
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
/* eslint-disable react/prop-types */
|
/* eslint-disable react/prop-types */
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { useTable, useBlockLayout, useRowSelect, useSortBy, useResizeColumns, useFlexLayout, useGlobalFilter } from 'react-table';
|
import { useTable, useRowSelect, useSortBy, useResizeColumns, useFlexLayout, useGlobalFilter } from 'react-table';
|
||||||
import { FixedSizeList } from 'react-window';
|
import { FixedSizeList } from 'react-window';
|
||||||
import { makeStyles } from '@material-ui/core/styles';
|
import { makeStyles } from '@material-ui/core/styles';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
@@ -83,8 +83,6 @@ export default function PgTable({ columns, data, isSelectRow, ...props }) {
|
|||||||
[]
|
[]
|
||||||
);
|
);
|
||||||
|
|
||||||
const scrollBarSize = React.useMemo(() => scrollbarWidth(), []);
|
|
||||||
|
|
||||||
const IndeterminateCheckbox = React.forwardRef(
|
const IndeterminateCheckbox = React.forwardRef(
|
||||||
({ indeterminate, ...rest }, ref) => {
|
({ indeterminate, ...rest }, ref) => {
|
||||||
const defaultRef = React.useRef();
|
const defaultRef = React.useRef();
|
||||||
@@ -117,7 +115,6 @@ export default function PgTable({ columns, data, isSelectRow, ...props }) {
|
|||||||
getTableBodyProps,
|
getTableBodyProps,
|
||||||
headerGroups,
|
headerGroups,
|
||||||
rows,
|
rows,
|
||||||
totalColumnsWidth,
|
|
||||||
prepareRow,
|
prepareRow,
|
||||||
selectedFlatRows,
|
selectedFlatRows,
|
||||||
state: { selectedRowIds },
|
state: { selectedRowIds },
|
||||||
@@ -262,16 +259,6 @@ export default function PgTable({ columns, data, isSelectRow, ...props }) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const scrollbarWidth = () => {
|
|
||||||
// thanks too https://davidwalsh.name/detect-scrollbar-width
|
|
||||||
const scrollDiv = document.createElement('div');
|
|
||||||
scrollDiv.setAttribute('style', 'width: 100px; height: 100px; overflow: scroll; position:absolute; top:-9999px;');
|
|
||||||
document.body.appendChild(scrollDiv);
|
|
||||||
const scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
|
|
||||||
document.body.removeChild(scrollDiv);
|
|
||||||
return scrollbarWidth;
|
|
||||||
};
|
|
||||||
|
|
||||||
PgTable.propTypes = {
|
PgTable.propTypes = {
|
||||||
stepId: PropTypes.number,
|
stepId: PropTypes.number,
|
||||||
height: PropTypes.number,
|
height: PropTypes.number,
|
||||||
|
|||||||
Reference in New Issue
Block a user