import styled, { css } from 'styled-components'; import { cssUnitCalc } from 'utils'; import Icon from 'kwai-icon'; import Drop from '../dropdown'; import theme from 'styles/theme'; export const HoverWrap = styled.div` position: absolute; z-index: 5; box-sizing: border-box; white-space: nowrap; min-width: 80px; height: 100%; display: inline-flex; align-items: center; right: 0; top: 0; font-size: 14px; color: #00a5aa; line-height: 20px; padding: 15px 16px; background: #f1f9fa; box-shadow: -6px 0 6px -6px rgba(0, 0, 0, 0.15); a { cursor: pointer; margin-left: 5px; } `; export const InlineFlex = styled.div` display: inline-flex; margin-top: 2px; cursor: pointer; user-select: none; svg { margin-top: 2px; } `; export const Dropdown = styled(Drop)` margin-top: 1px; span { color: #9aa0b1; } text-align: left; `; export const SortIcon = styled(Icon).attrs(() => ({ name: 'Sort', size: 'small', color: '#9aa0b1', fillColorRule: '&&& path', }))` &&&.ascend path:first-child { fill: ${p => p.theme.brand}; } &&&.descend path:last-child { fill: ${p => p.theme.brand}; } `; SortIcon.defaultProps = { theme }; export const Wrapper = styled.div` width: 100%; position: relative; height: ${p => cssUnitCalc(p.height)}; overflow: auto; `; export const TableStyle = styled.table` width: 100%; border-spacing: 0; ${p => p.scroll && css` width: ${cssUnitCalc(p.scroll)}; `} tr { position: relative; height: 48px; font-size: 14px; letter-spacing: 0.3px; line-height: 20px; td, th { position: relative; padding: 0 16px; box-sizing: border-box; vertical-align: middle; } } thead tr { color: #9aa0b1; } tbody tr { color: #101934; } .summary-row-fixed td { position: sticky; top: 48px; z-index: 1; } .header-row-fixed td { position: sticky; top: 0; z-index: 1; } .summary-row-fixed, .header-row-fixed { td.fix-left-cell, td.fix-right-cell { z-index: 3; } } `; export const SummaryRow = styled.tr` background: #fbfbfb; td { background: #fbfbfb; } `; export const Row = styled.tr` background: white; td { background: white; } &:hover { background: #f1f9fa; td { background: #f1f9fa; } } &&&&:last-of-type { .fixed-last::after { height: 100%; } } `; export const HeaderRow = styled.tr` background: white; td { border-bottom: 1px solid #ededed; background: white; } `; export const TD = styled.td` width: ${p => cssUnitCalc(p.width || 'auto')}; text-align: ${p => p.align || 'center'}; ${p => p.checker && css` &&&& { padding-left: 16px; label { margin-top: 3px; } } `}; &.fix-left-cell { position: sticky; z-index: 2; left: ${p => p.offset}px; &.fixed-last::after { content: ''; position: absolute; width: 20px; height: 114%; top: 0; bottom: 0; right: 0; box-shadow: 6px 0 6px -4px rgba(0, 0, 0, 0.15); //box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.75); } } &.fix-right-cell { position: sticky; z-index: 2; right: ${p => p.offset}px; &.fixed-last::after { content: ''; position: absolute; width: 20px; height: 114%; top: -6px; left: 0; box-shadow: -6px 0 6px -4px rgba(0, 0, 0, 0.15); } } `; export const PaginationContainer = styled.div` text-align: right; margin-top: 24px; `; export const NoDataTd = styled.td.attrs(() => ({ colSpan: 1000 }))``; export const NoDataWrap = styled.div` min-height: 320px; display: flex; align-items: center; justify-content: center; font-size: 14px; color: #7d818d; letter-spacing: 0.3px; `;