2021-07-15 13:56:12 +00:00
|
|
|
import styled, { css } from "styled-components";
|
2021-07-23 15:13:06 +00:00
|
|
|
import Base from "../themes/base";
|
2021-10-15 11:33:48 +00:00
|
|
|
import { mobile, tablet } from "../utils/device";
|
|
|
|
import Scrollbar from "../scrollbar";
|
2021-10-22 14:08:51 +00:00
|
|
|
import { isMobile } from "react-device-detect";
|
2021-07-09 08:59:20 +00:00
|
|
|
|
2021-07-15 07:57:06 +00:00
|
|
|
const StyledTableContainer = styled.div`
|
2021-09-09 14:29:09 +00:00
|
|
|
-moz-user-select: none;
|
|
|
|
|
2022-04-06 11:34:00 +00:00
|
|
|
width: 100%;
|
2021-07-13 08:07:50 +00:00
|
|
|
max-width: 100%;
|
2022-03-17 10:28:09 +00:00
|
|
|
margin-top: -19px;
|
2021-07-15 07:57:06 +00:00
|
|
|
|
|
|
|
display: grid;
|
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-27 13:02:25 +00:00
|
|
|
margin: 14px 8px 0 auto;
|
2021-07-09 08:59:20 +00:00
|
|
|
z-index: 1;
|
2021-12-15 09:26:45 +00:00
|
|
|
border-right: ${(props) => props.theme.tableContainer.borderRight};
|
2021-11-08 11:24:11 +00:00
|
|
|
&:hover {
|
2021-12-15 09:26:45 +00:00
|
|
|
border-color: ${(props) => props.theme.tableContainer.hoverBorderColor};
|
2021-11-08 11:24:11 +00:00
|
|
|
}
|
2021-07-09 08:59:20 +00:00
|
|
|
}
|
|
|
|
|
2021-10-25 12:21:13 +00:00
|
|
|
.table-container_group-menu,
|
|
|
|
.table-container_header {
|
2022-02-24 08:20:32 +00:00
|
|
|
padding: 0 20px;
|
2021-09-30 13:27:01 +00:00
|
|
|
|
|
|
|
border-bottom: 1px solid;
|
|
|
|
border-image-slice: 1;
|
2021-12-15 09:26:45 +00:00
|
|
|
border-image-source: ${(props) =>
|
|
|
|
props.theme.tableContainer.header.borderImageSource};
|
2021-10-11 14:51:01 +00:00
|
|
|
border-top: 0;
|
2021-09-30 13:27:01 +00:00
|
|
|
}
|
2022-01-27 07:35:36 +00:00
|
|
|
.lengthen-header {
|
2022-03-05 14:47:56 +00:00
|
|
|
border-bottom: ${(props) => props.theme.tableContainer.header.borderBottom};
|
2022-01-27 07:35:36 +00:00
|
|
|
border-image-source: none;
|
|
|
|
}
|
2021-09-30 13:27:01 +00:00
|
|
|
|
2021-07-09 08:59:20 +00:00
|
|
|
.content-container {
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
|
|
|
|
|
|
|
.children-wrap {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
}
|
|
|
|
|
|
|
|
.table-cell {
|
|
|
|
height: 47px;
|
2021-12-15 09:26:45 +00:00
|
|
|
border-bottom: ${(props) => props.theme.tableContainer.tableCellBorder};
|
2021-07-09 08:59:20 +00:00
|
|
|
}
|
2021-07-20 10:29:39 +00:00
|
|
|
|
|
|
|
.table-container_group-menu {
|
|
|
|
.table-container_group-menu-checkbox {
|
|
|
|
width: 22px;
|
|
|
|
}
|
|
|
|
}
|
2021-07-09 08:59:20 +00:00
|
|
|
`;
|
|
|
|
|
2021-12-15 09:26:45 +00:00
|
|
|
StyledTableContainer.defaultProps = { theme: Base };
|
|
|
|
|
2021-07-15 13:56:12 +00:00
|
|
|
const StyledTableGroupMenu = styled.div`
|
2021-10-13 13:04:49 +00:00
|
|
|
position: relative;
|
2021-12-15 09:26:45 +00:00
|
|
|
background: ${(props) => props.theme.tableContainer.groupMenu.background};
|
2022-01-24 09:56:02 +00:00
|
|
|
border-bottom: ${(props) =>
|
|
|
|
props.theme.tableContainer.groupMenu.borderBottom};
|
2021-07-15 13:56:12 +00:00
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
align-items: center;
|
2021-10-13 13:04:49 +00:00
|
|
|
width: 100%;
|
2021-10-22 12:53:26 +00:00
|
|
|
z-index: 199;
|
2022-03-28 13:45:17 +00:00
|
|
|
height: 53px;
|
2022-01-24 09:56:02 +00:00
|
|
|
box-shadow: ${(props) => props.theme.tableContainer.groupMenu.boxShadow};
|
2021-10-13 13:04:49 +00:00
|
|
|
border-radius: 0px 0px 6px 6px;
|
2021-10-19 14:36:47 +00:00
|
|
|
margin: 0;
|
|
|
|
width: 100%;
|
2021-07-15 13:56:12 +00:00
|
|
|
|
2021-10-14 15:18:08 +00:00
|
|
|
@media ${tablet} {
|
|
|
|
height: 60px;
|
|
|
|
}
|
|
|
|
|
2021-10-15 11:33:48 +00:00
|
|
|
@media ${mobile} {
|
|
|
|
height: 52px;
|
|
|
|
}
|
|
|
|
|
2021-08-02 15:16:15 +00:00
|
|
|
.table-container_group-menu-checkbox {
|
2021-10-13 14:44:40 +00:00
|
|
|
margin-left: 24px;
|
2021-08-02 15:16:15 +00:00
|
|
|
${(props) => props.checkboxMargin && `margin-left: ${props.checkboxMargin}`}
|
|
|
|
}
|
|
|
|
|
2021-10-13 14:44:40 +00:00
|
|
|
.table-container_group-menu-separator {
|
2021-12-15 09:26:45 +00:00
|
|
|
border-right: ${(props) =>
|
|
|
|
props.theme.tableContainer.groupMenu.borderRight};
|
2021-10-13 14:44:40 +00:00
|
|
|
width: 2px;
|
|
|
|
height: 20px;
|
|
|
|
margin: 0 8px;
|
|
|
|
}
|
|
|
|
|
2021-07-15 13:56:12 +00:00
|
|
|
.table-container_group-menu_button {
|
|
|
|
margin-right: 8px;
|
|
|
|
}
|
2021-10-13 13:04:49 +00:00
|
|
|
|
|
|
|
.table-container_group-menu-combobox {
|
|
|
|
height: 24px;
|
|
|
|
width: 16px;
|
2021-10-13 14:44:40 +00:00
|
|
|
margin: 3px 0px 0px 3px;
|
2021-10-13 13:04:49 +00:00
|
|
|
|
|
|
|
.combo-button {
|
|
|
|
.combo-buttons_arrow-icon {
|
2021-10-13 14:44:40 +00:00
|
|
|
margin: 1px 16px 0 0;
|
2021-10-13 13:04:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-07-15 07:57:06 +00:00
|
|
|
`;
|
|
|
|
|
2021-12-15 09:26:45 +00:00
|
|
|
StyledTableGroupMenu.defaultProps = { theme: Base };
|
|
|
|
|
2022-03-24 14:57:36 +00:00
|
|
|
const StyledInfoPanelToggleWrapper = styled.div`
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
align-self: center;
|
|
|
|
justify-content: center;
|
|
|
|
margin: 0 20px 0 auto;
|
|
|
|
height: 100%;
|
|
|
|
width: auto;
|
|
|
|
padding-left: 20px;
|
|
|
|
|
|
|
|
@media ${tablet} {
|
|
|
|
margin: 0 16px 0 auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
.info-panel-toggle-bg {
|
|
|
|
height: 32px;
|
|
|
|
width: 32px;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
border-radius: 50%;
|
|
|
|
background-color: ${(props) =>
|
2022-03-29 10:59:56 +00:00
|
|
|
props.isInfoPanelVisible
|
|
|
|
? props.theme.infoPanel.sectionHeaderToggleBgActive
|
|
|
|
: props.theme.infoPanel.sectionHeaderToggleBg};
|
|
|
|
|
|
|
|
path {
|
|
|
|
fill: ${(props) =>
|
|
|
|
props.isInfoPanelVisible
|
|
|
|
? props.theme.infoPanel.sectionHeaderToggleIconActive
|
|
|
|
: props.theme.infoPanel.sectionHeaderToggleIcon};
|
|
|
|
}
|
2022-04-11 08:11:44 +00:00
|
|
|
|
|
|
|
margin-bottom: 1px;
|
2022-03-24 14:57:36 +00:00
|
|
|
}
|
|
|
|
`;
|
2022-03-29 10:59:56 +00:00
|
|
|
StyledInfoPanelToggleWrapper.defaultProps = { theme: Base };
|
2022-03-24 14:57:36 +00:00
|
|
|
|
2021-07-15 07:57:06 +00:00
|
|
|
const StyledTableHeader = styled.div`
|
2021-10-13 13:04:49 +00:00
|
|
|
position: fixed;
|
2021-12-15 09:26:45 +00:00
|
|
|
background: ${(props) => props.theme.tableContainer.header.background};
|
2021-07-15 07:57:06 +00:00
|
|
|
display: grid;
|
2021-10-13 13:04:49 +00:00
|
|
|
z-index: 1;
|
|
|
|
height: 39px;
|
2021-12-15 09:26:45 +00:00
|
|
|
border-bottom: ${(props) => props.theme.tableContainer.header.borderBottom};
|
2021-10-22 12:01:43 +00:00
|
|
|
margin: 0 -20px;
|
|
|
|
padding: 0 20px;
|
2021-07-22 13:55:26 +00:00
|
|
|
|
2021-08-02 15:16:15 +00:00
|
|
|
.table-container_header-checkbox {
|
|
|
|
${(props) => props.checkboxMargin && `margin-left: ${props.checkboxMargin}`}
|
|
|
|
}
|
|
|
|
|
2021-07-22 13:55:26 +00:00
|
|
|
.table-container_header-cell {
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
2021-07-15 07:57:06 +00:00
|
|
|
`;
|
2021-07-15 13:56:12 +00:00
|
|
|
|
2021-12-15 09:26:45 +00:00
|
|
|
StyledTableHeader.defaultProps = { theme: Base };
|
|
|
|
|
2021-07-20 10:29:39 +00:00
|
|
|
const StyledTableHeaderCell = styled.div`
|
2022-02-16 10:57:59 +00:00
|
|
|
cursor: ${(props) =>
|
|
|
|
props.showIcon && props.sortingVisible ? "pointer" : "default"};
|
2021-07-20 10:29:39 +00:00
|
|
|
|
2021-09-03 09:53:03 +00:00
|
|
|
.header-container-text-icon {
|
2021-10-18 09:22:33 +00:00
|
|
|
padding: 13px 0 0 4px;
|
2021-07-20 10:29:39 +00:00
|
|
|
|
2021-09-03 09:53:03 +00:00
|
|
|
display: ${(props) =>
|
|
|
|
props.isActive && props.showIcon ? "block" : "none"};
|
|
|
|
${(props) =>
|
|
|
|
props.sorted &&
|
|
|
|
css`
|
|
|
|
transform: scale(1, -1);
|
2022-02-24 08:20:32 +00:00
|
|
|
padding: 14px 0 14px 4px;
|
2021-09-03 09:53:03 +00:00
|
|
|
`}
|
2021-12-15 09:26:45 +00:00
|
|
|
|
|
|
|
svg {
|
2022-04-08 11:48:02 +00:00
|
|
|
width: 12px;
|
|
|
|
height: 12px;
|
2021-12-15 09:26:45 +00:00
|
|
|
path {
|
|
|
|
fill: ${(props) =>
|
|
|
|
props.isActive
|
|
|
|
? props.theme.tableContainer.header.activeIconColor
|
|
|
|
: props.theme.tableContainer.header.iconColor} !important;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
path {
|
|
|
|
fill: ${(props) =>
|
|
|
|
props.theme.tableContainer.header.hoverIconColor} !important;
|
|
|
|
}
|
|
|
|
}
|
2021-09-03 09:53:03 +00:00
|
|
|
}
|
2021-07-20 10:29:39 +00:00
|
|
|
|
2021-09-03 09:53:03 +00:00
|
|
|
:hover {
|
|
|
|
.header-container-text-icon {
|
2021-07-20 10:29:39 +00:00
|
|
|
${(props) =>
|
2021-09-03 09:53:03 +00:00
|
|
|
props.showIcon &&
|
2021-07-20 10:29:39 +00:00
|
|
|
css`
|
2021-09-03 09:53:03 +00:00
|
|
|
display: block;
|
|
|
|
`};
|
2021-07-20 10:29:39 +00:00
|
|
|
}
|
2021-09-03 09:53:03 +00:00
|
|
|
}
|
2021-07-27 12:22:51 +00:00
|
|
|
|
2021-09-03 09:53:03 +00:00
|
|
|
.table-container_header-item {
|
|
|
|
display: flex;
|
|
|
|
user-select: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.header-container-text-wrapper {
|
|
|
|
display: flex;
|
2021-07-20 10:29:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.header-container-text {
|
|
|
|
height: 38px;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
2021-12-15 09:26:45 +00:00
|
|
|
color: ${(props) =>
|
|
|
|
props.isActive
|
|
|
|
? props.theme.tableContainer.header.activeTextColor
|
|
|
|
: props.theme.tableContainer.header.textColor} !important;
|
|
|
|
|
2021-11-08 11:24:11 +00:00
|
|
|
&:hover {
|
2021-12-15 09:26:45 +00:00
|
|
|
color: ${(props) =>
|
|
|
|
props.theme.tableContainer.header.hoverTextColor} !important;
|
2021-11-08 11:24:11 +00:00
|
|
|
}
|
2021-07-20 10:29:39 +00:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2021-12-15 09:26:45 +00:00
|
|
|
StyledTableHeaderCell.defaultProps = { theme: Base };
|
|
|
|
|
2021-07-15 07:57:06 +00:00
|
|
|
const StyledTableBody = styled.div`
|
|
|
|
display: contents;
|
|
|
|
`;
|
2021-07-15 13:56:12 +00:00
|
|
|
|
|
|
|
const StyledTableRow = styled.div`
|
|
|
|
display: contents;
|
2021-07-23 15:13:06 +00:00
|
|
|
|
2021-07-29 17:21:26 +00:00
|
|
|
.table-container_header-checkbox {
|
|
|
|
svg {
|
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-07-23 15:13:06 +00:00
|
|
|
.droppable-hover {
|
|
|
|
background: ${(props) =>
|
2021-08-25 13:53:26 +00:00
|
|
|
props.dragging
|
|
|
|
? `${props.theme.dragAndDrop.acceptBackground} !important`
|
|
|
|
: "none"};
|
2021-07-23 15:13:06 +00:00
|
|
|
}
|
2021-11-16 09:43:29 +00:00
|
|
|
|
|
|
|
.table-container_row-loader {
|
|
|
|
display: inline-flex;
|
|
|
|
}
|
2021-07-15 13:56:12 +00:00
|
|
|
`;
|
|
|
|
|
2021-07-15 07:57:06 +00:00
|
|
|
const StyledTableCell = styled.div`
|
2021-07-22 13:55:26 +00:00
|
|
|
/* padding-right: 8px; */
|
2021-07-15 07:57:06 +00:00
|
|
|
height: 40px;
|
|
|
|
max-height: 40px;
|
2021-12-15 09:26:45 +00:00
|
|
|
border-bottom: ${(props) => props.theme.tableContainer.tableCell.border};
|
2021-07-22 13:55:26 +00:00
|
|
|
overflow: hidden;
|
2021-07-15 07:57:06 +00:00
|
|
|
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
.react-svg-icon svg {
|
|
|
|
margin-top: 2px;
|
|
|
|
}
|
2021-08-16 09:15:36 +00:00
|
|
|
|
|
|
|
.table-container_element {
|
|
|
|
display: ${(props) => (props.checked ? "none" : "flex")};
|
|
|
|
}
|
|
|
|
.table-container_row-checkbox {
|
|
|
|
display: ${(props) => (props.checked ? "flex" : "none")};
|
2021-11-19 11:04:02 +00:00
|
|
|
padding: 12px;
|
|
|
|
margin-left: -12px;
|
2021-08-16 09:15:36 +00:00
|
|
|
}
|
|
|
|
|
2021-08-26 14:47:21 +00:00
|
|
|
${(props) =>
|
|
|
|
props.hasAccess &&
|
|
|
|
css`
|
|
|
|
:hover {
|
|
|
|
.table-container_element {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
.table-container_row-checkbox {
|
|
|
|
display: flex;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`}
|
2021-07-09 08:59:20 +00:00
|
|
|
`;
|
|
|
|
|
2021-12-15 09:26:45 +00:00
|
|
|
StyledTableCell.defaultProps = { theme: Base };
|
|
|
|
|
2021-07-19 11:09:09 +00:00
|
|
|
const StyledTableSettings = styled.div`
|
|
|
|
margin: 14px 0 0px 8px;
|
|
|
|
display: inline-block;
|
|
|
|
position: relative;
|
|
|
|
cursor: pointer;
|
|
|
|
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
|
|
|
|
|
|
|
.table-container_settings-checkbox {
|
|
|
|
padding: 8px 16px;
|
|
|
|
}
|
2021-07-15 07:57:06 +00:00
|
|
|
`;
|
2021-07-13 08:07:50 +00:00
|
|
|
|
2021-07-20 13:01:54 +00:00
|
|
|
const StyledEmptyTableContainer = styled.div`
|
|
|
|
grid-column-start: 1;
|
|
|
|
grid-column-end: -1;
|
|
|
|
height: 40px;
|
|
|
|
`;
|
|
|
|
|
2021-10-15 11:33:48 +00:00
|
|
|
const StyledScrollbar = styled(Scrollbar)`
|
|
|
|
.scroll-body {
|
|
|
|
display: flex;
|
|
|
|
}
|
2022-03-24 14:57:36 +00:00
|
|
|
.nav-thumb-vertical {
|
|
|
|
display: none !important;
|
|
|
|
}
|
2021-10-20 11:27:21 +00:00
|
|
|
.nav-thumb-horizontal {
|
2021-10-22 14:08:51 +00:00
|
|
|
${isMobile && "display: none !important"};
|
2021-10-20 11:27:21 +00:00
|
|
|
}
|
2021-10-15 11:33:48 +00:00
|
|
|
`;
|
|
|
|
|
2021-07-23 15:13:06 +00:00
|
|
|
StyledTableRow.defaultProps = { theme: Base };
|
|
|
|
|
2021-07-13 08:07:50 +00:00
|
|
|
export {
|
|
|
|
StyledTableContainer,
|
|
|
|
StyledTableRow,
|
|
|
|
StyledTableBody,
|
|
|
|
StyledTableHeader,
|
2021-07-20 10:29:39 +00:00
|
|
|
StyledTableHeaderCell,
|
2021-07-13 08:07:50 +00:00
|
|
|
StyledTableCell,
|
2021-07-19 11:09:09 +00:00
|
|
|
StyledTableSettings,
|
2021-07-15 13:56:12 +00:00
|
|
|
StyledTableGroupMenu,
|
2022-03-24 14:57:36 +00:00
|
|
|
StyledInfoPanelToggleWrapper,
|
2021-07-20 13:01:54 +00:00
|
|
|
StyledEmptyTableContainer,
|
2021-10-15 11:33:48 +00:00
|
|
|
StyledScrollbar,
|
2021-07-13 08:07:50 +00:00
|
|
|
};
|