Add scrollable wrapper to the new table component (#2692)
This commit is contained in:
parent
55c8d6ac2d
commit
8731de1520
7 changed files with 96 additions and 86 deletions
|
@ -20,9 +20,10 @@ export const Container = styled.main(
|
||||||
position: relative;
|
position: relative;
|
||||||
padding-bottom: 30px;
|
padding-bottom: 30px;
|
||||||
z-index: 20;
|
z-index: 20;
|
||||||
|
max-width: calc(100vw - ${theme.layout.navBarWidth});
|
||||||
@media screen and (max-width: 1023px) {
|
@media screen and (max-width: 1023px) {
|
||||||
margin-left: initial;
|
margin-left: initial;
|
||||||
|
max-width: 100vw;
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
);
|
);
|
||||||
|
|
|
@ -12,7 +12,7 @@ export const Value = styled.span`
|
||||||
line-height: 24px;
|
line-height: 24px;
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
width: 600px;
|
max-width: 400px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
`;
|
`;
|
||||||
|
|
|
@ -70,7 +70,7 @@ const InputCell: React.FC<InputCellProps> = ({ row, getValue, onUpdate }) => {
|
||||||
: { fontWeight: 400 }
|
: { fontWeight: 400 }
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<S.Value>{initialValue}</S.Value>
|
<S.Value title={initialValue}>{initialValue}</S.Value>
|
||||||
<Button
|
<Button
|
||||||
buttonType="primary"
|
buttonType="primary"
|
||||||
buttonSize="S"
|
buttonSize="S"
|
||||||
|
|
|
@ -14,7 +14,7 @@ export const Wrapper = styled.div(
|
||||||
|
|
||||||
export const Sidebar = styled.div(
|
export const Sidebar = styled.div(
|
||||||
({ theme }) => css`
|
({ theme }) => css`
|
||||||
width: 300px;
|
width: ${theme.layout.filtersSidebarWidth};
|
||||||
position: sticky;
|
position: sticky;
|
||||||
top: ${theme.layout.navBarHeight};
|
top: ${theme.layout.navBarHeight};
|
||||||
align-self: start;
|
align-self: start;
|
||||||
|
@ -27,7 +27,9 @@ export const SidebarContent = styled.div`
|
||||||
|
|
||||||
export const TableWrapper = styled.div(
|
export const TableWrapper = styled.div(
|
||||||
({ theme }) => css`
|
({ theme }) => css`
|
||||||
width: 100%;
|
width: calc(
|
||||||
|
100vw - ${theme.layout.navBarWidth} - ${theme.layout.filtersSidebarWidth}
|
||||||
|
);
|
||||||
border-left: 1px solid ${theme.layout.stuffBorderColor};
|
border-left: 1px solid ${theme.layout.stuffBorderColor};
|
||||||
`
|
`
|
||||||
);
|
);
|
||||||
|
|
|
@ -211,3 +211,7 @@ export const Ellipsis = styled.div`
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
display: block;
|
display: block;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
export const TableWrapper = styled.div`
|
||||||
|
overflow-x: auto;
|
||||||
|
`;
|
||||||
|
|
|
@ -198,6 +198,7 @@ const Table: React.FC<TableProps<any>> = ({
|
||||||
/>
|
/>
|
||||||
</S.TableActionsBar>
|
</S.TableActionsBar>
|
||||||
)}
|
)}
|
||||||
|
<S.TableWrapper>
|
||||||
<S.Table>
|
<S.Table>
|
||||||
<thead>
|
<thead>
|
||||||
{table.getHeaderGroups().map((headerGroup) => (
|
{table.getHeaderGroups().map((headerGroup) => (
|
||||||
|
@ -287,6 +288,7 @@ const Table: React.FC<TableProps<any>> = ({
|
||||||
)}
|
)}
|
||||||
</tbody>
|
</tbody>
|
||||||
</S.Table>
|
</S.Table>
|
||||||
|
</S.TableWrapper>
|
||||||
{table.getPageCount() > 1 && (
|
{table.getPageCount() > 1 && (
|
||||||
<S.Pagination>
|
<S.Pagination>
|
||||||
<S.Pages>
|
<S.Pages>
|
||||||
|
|
|
@ -90,6 +90,7 @@ const theme = {
|
||||||
navBarWidth: '201px',
|
navBarWidth: '201px',
|
||||||
navBarHeight: '53px',
|
navBarHeight: '53px',
|
||||||
rightSidebarWidth: '70vw',
|
rightSidebarWidth: '70vw',
|
||||||
|
filtersSidebarWidth: '300px',
|
||||||
|
|
||||||
stuffColor: Colors.neutral[5],
|
stuffColor: Colors.neutral[5],
|
||||||
stuffBorderColor: Colors.neutral[10],
|
stuffBorderColor: Colors.neutral[10],
|
||||||
|
|
Loading…
Add table
Reference in a new issue