2022-05-31 10:10:35 +08:00
|
|
|
import type { CSSObject } from '@ant-design/cssinjs';
|
2022-10-28 16:44:19 +08:00
|
|
|
import { textEllipsis } from '../../style';
|
2022-11-23 20:22:38 +08:00
|
|
|
import type { GenerateStyle } from '../../theme/internal';
|
2022-05-31 10:10:35 +08:00
|
|
|
import type { TableToken } from './index';
|
|
|
|
|
2022-11-19 13:47:33 +08:00
|
|
|
const genEllipsisStyle: GenerateStyle<TableToken, CSSObject> = (token) => {
|
2022-05-31 10:10:35 +08:00
|
|
|
const { componentCls } = token;
|
|
|
|
return {
|
|
|
|
[`${componentCls}-wrapper`]: {
|
|
|
|
[`${componentCls}-cell-ellipsis`]: {
|
2022-10-28 16:44:19 +08:00
|
|
|
...textEllipsis,
|
2022-05-31 10:10:35 +08:00
|
|
|
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;
|