DocSpace-buildtools/packages/asc-web-components/table-container/StyledTableContainer.js

124 lines
2.0 KiB
JavaScript
Raw Normal View History

import styled, { css } from "styled-components";
2021-07-15 07:57:06 +00:00
import SettingsIcon from "./svg/settings.react.svg";
2021-07-09 08:59:20 +00:00
const HeaderStyles = css`
height: 39px;
position: fixed;
background: #fff;
z-index: 1;
border-bottom: 1px solid #eceef1;
`;
2021-07-15 07:57:06 +00:00
const StyledTableContainer = styled.div`
2021-07-09 08:59:20 +00:00
width: 100%;
2021-07-13 08:07:50 +00:00
max-width: 100%;
margin-top: -18px;
2021-07-15 07:57:06 +00:00
display: grid;
grid-template-columns:
32px
minmax(180px, 2fr)
minmax(150px, 1fr)
minmax(150px, 1fr)
minmax(150px, 1fr)
80px
24px;
2021-07-09 08:59:20 +00:00
.table-column {
user-select: none;
position: relative;
min-width: 10%;
}
.resize-handle {
display: block;
cursor: ew-resize;
height: 10px;
2021-07-13 08:07:50 +00:00
margin: 14px 4px 0 auto;
2021-07-09 08:59:20 +00:00
z-index: 1;
border-right: 2px solid #d0d5da;
2021-07-09 08:59:20 +00:00
}
.header-container {
height: 38px;
display: flex;
align-items: center;
2021-07-09 08:59:20 +00:00
}
.content-container {
overflow: hidden;
}
.children-wrap {
display: flex;
flex-direction: column;
}
.table-cell {
height: 47px;
border-bottom: 1px solid #eceef1;
}
`;
const StyledTableGroupMenu = styled.div`
display: flex;
flex-direction: row;
align-items: center;
${HeaderStyles}
.table-container_group-menu_button {
margin-right: 8px;
}
2021-07-15 07:57:06 +00:00
`;
const StyledTableHeader = styled.div`
display: grid;
grid-template-columns:
32px
minmax(180px, 2fr)
minmax(150px, 1fr)
minmax(150px, 1fr)
minmax(150px, 1fr)
80px
24px;
${HeaderStyles}
2021-07-15 07:57:06 +00:00
`;
2021-07-15 07:57:06 +00:00
const StyledTableBody = styled.div`
display: contents;
`;
const StyledTableRow = styled.div`
display: contents;
`;
2021-07-15 07:57:06 +00:00
const StyledTableCell = styled.div`
padding-right: 8px;
2021-07-15 07:57:06 +00:00
height: 40px;
max-height: 40px;
2021-07-09 08:59:20 +00:00
border-bottom: 1px solid #eceef1;
2021-07-15 07:57:06 +00:00
display: flex;
align-items: center;
.react-svg-icon svg {
margin-top: 2px;
}
2021-07-09 08:59:20 +00:00
`;
2021-07-15 07:57:06 +00:00
const StyledSettingsIcon = styled(SettingsIcon)`
margin-top: 12px;
`;
2021-07-13 08:07:50 +00:00
export {
StyledTableContainer,
StyledTableRow,
StyledTableBody,
StyledTableHeader,
StyledTableCell,
2021-07-15 07:57:06 +00:00
StyledSettingsIcon,
StyledTableGroupMenu,
2021-07-13 08:07:50 +00:00
};