ant-design/components/table/style/ellipsis.tsx
二货机器人 de2992f96f
chore: move path (#36243)
* chore: base move

* chore: all path

* chore: fix script
2022-06-27 14:25:59 +08:00

39 lines
1.0 KiB
TypeScript

import type { CSSObject } from '@ant-design/cssinjs';
import type { GenerateStyle } from '../../theme';
import type { TableToken } from './index';
const genEllipsisStyle: GenerateStyle<TableToken, CSSObject> = token => {
const { componentCls } = token;
return {
[`${componentCls}-wrapper`]: {
[`${componentCls}-cell-ellipsis`]: {
overflow: 'hidden',
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
wordBreak: 'keep-all',
// Fixed first or last should special process
[`
&${componentCls}-cell-fix-left-last,
&${componentCls}-cell-fix-right-first
`]: {
overflow: 'visible',
[`${componentCls}-cell-content`]: {
display: 'block',
overflow: 'hidden',
textOverflow: 'ellipsis',
},
},
[`${componentCls}-column-title`]: {
overflow: 'hidden',
textOverflow: 'ellipsis',
wordBreak: 'keep-all',
},
},
},
};
};
export default genEllipsisStyle;