210 lines
3.5 KiB
JavaScript
Raw Normal View History

/* eslint-disable */
import React from 'react';
2019-07-09 16:56:40 +02:00
import styled, { css } from 'styled-components';
import { Carret } from '@buffetjs/icons';
import { themePropTypes } from 'strapi-helper-plugin';
2019-07-09 16:56:40 +02:00
const Table = styled.table`
border-radius: 3px;
border-collapse: initial;
box-shadow: 0 2px 4px #e3e9f3;
table-layout: fixed;
2019-08-28 16:12:51 +02:00
margin-bottom: 0;
2019-07-09 16:56:40 +02:00
tr,
th,
td {
border: none;
padding: 0;
}
2019-07-12 14:12:07 +02:00
th,
2019-07-09 16:56:40 +02:00
td {
padding: 0 25px;
2019-09-24 18:42:08 +02:00
label {
display: inline;
}
2019-07-09 16:56:40 +02:00
}
`;
const Thead = styled.thead`
background: #f3f3f3;
2019-08-28 16:12:51 +02:00
height: 43px;
2019-07-09 16:56:40 +02:00
overflow: hidden;
th {
2019-08-28 16:12:51 +02:00
height: 43px;
2019-07-09 16:56:40 +02:00
border: none !important;
font-size: 1.3rem;
vertical-align: middle !important;
> span {
position: relative;
2019-09-13 16:04:15 +02:00
&.sortable {
cursor: pointer;
}
2019-07-09 16:56:40 +02:00
}
}
${({ isBulkable }) => {
if (isBulkable) {
return css`
> tr {
th:first-child {
width: 50px;
}
}
`;
}
}}
`;
const TableEmpty = styled.tr`
width: 100%;
height: 108px;
background: #ffffff;
td {
height: 106px;
2019-08-28 16:12:51 +02:00
line-height: 90px;
2019-07-09 16:56:40 +02:00
font-size: 1.3rem;
font-weight: 400;
color: #333740;
text-align: center;
border-collapse: collapse;
border-top: 1px solid #f1f1f2 !important;
}
`;
const TableRow = styled.tr`
height: 54px;
background: #ffffff;
&:hover {
cursor: pointer;
background: #f7f8f8;
}
td {
height: 53px;
font-size: 1.3rem;
2019-08-28 16:12:51 +02:00
line-height: 1.8rem;
2019-07-09 16:56:40 +02:00
font-weight: 400;
color: #333740;
2019-08-28 16:12:51 +02:00
vertical-align: middle;
2019-07-09 16:56:40 +02:00
border-collapse: collapse;
border-top: 1px solid #f1f1f2 !important;
}
`;
const Arrow = styled(({ isUp, ...rest }) => <Carret {...rest} />)`
margin-left: 5px;
${({ isUp }) =>
isUp &&
`
transform: rotateZ(180deg);
`}
2019-07-09 16:56:40 +02:00
`;
2019-09-02 17:25:30 +02:00
const Truncate = styled.div``;
2019-07-09 16:56:40 +02:00
2019-08-28 16:12:51 +02:00
const Truncated = styled.p`
2019-07-09 16:56:40 +02:00
overflow-x: hidden;
text-overflow: ellipsis;
white-space: nowrap;
2019-08-28 16:12:51 +02:00
margin-bottom: 0;
2019-07-09 16:56:40 +02:00
`;
2019-07-09 19:38:39 +02:00
const TableDelete = styled.tr`
width: 100%;
height: 36px;
background: #f7f8f8;
td {
height: 36px;
line-height: 36px;
font-size: 1.3rem;
font-weight: 400;
color: #333740;
text-align: left;
border-collapse: collapse;
border-top: 1px solid #f1f1f2 !important;
}
`;
2019-07-09 16:56:40 +02:00
const ActionContainer = styled.td`
text-align: right;
2019-11-19 16:17:15 +01:00
i,
svg {
2019-07-09 16:56:40 +02:00
margin-left: 15px;
2019-11-25 15:56:44 +01:00
font-size: 1rem;
2019-12-10 11:26:18 +01:00
color: #333740;
2019-07-09 16:56:40 +02:00
&:first-of-type {
margin-left: 0px;
}
}
`;
2019-07-09 19:38:39 +02:00
const DeleteSpan = styled.span`
font-weight: 600;
2019-11-21 16:49:06 +01:00
-webkit-font-smoothing: antialiased;
2019-07-09 19:38:39 +02:00
&:after {
content: '—';
margin: 0 7px;
font-size: 13px;
font-weight: 600;
}
`;
const DeletAllSpan = styled.span`
position: absolute;
color: #f64d0a;
font-weight: 500;
cursor: pointer;
&:after {
position: relative;
top: -1px;
content: '\f2ed';
2019-07-09 19:38:39 +02:00
margin-left: 7px;
font-size: 10px;
2019-07-09 19:38:39 +02:00
font-family: FontAwesome;
-webkit-font-smoothing: antialiased;
}
`;
2019-07-09 16:56:40 +02:00
const LoadingContainer = styled.div`
display: block;
margin: auto;
`;
const LoadingWrapper = styled.div`
width: 100%;
height: 108px;
display: flex;
background: ${props => props.theme.main.colors.white};
box-shadow: 0 2px 4px ${props => props.theme.main.colors.darkGrey};
clip-path: inset(0px -5px -5px -5px);
`;
LoadingWrapper.propTypes = {
...themePropTypes,
};
2019-07-09 16:56:40 +02:00
export {
ActionContainer,
2019-11-21 16:49:06 +01:00
Arrow,
2019-07-09 19:38:39 +02:00
DeletAllSpan,
DeleteSpan,
LoadingContainer,
LoadingWrapper,
2019-07-09 16:56:40 +02:00
Table,
2019-07-09 19:38:39 +02:00
TableDelete,
2019-07-09 16:56:40 +02:00
TableEmpty,
TableRow,
Thead,
Truncate,
Truncated,
};