2022-05-31 10:10:35 +08:00
|
|
|
import type { CSSObject } from '@ant-design/cssinjs';
|
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 genRadiusStyle: GenerateStyle<TableToken, CSSObject> = (token) => {
|
2022-06-02 18:47:14 +08:00
|
|
|
const { componentCls, tableRadius } = token;
|
2022-05-31 10:10:35 +08:00
|
|
|
return {
|
|
|
|
[`${componentCls}-wrapper`]: {
|
|
|
|
[componentCls]: {
|
2022-12-22 16:51:09 +08:00
|
|
|
// https://github.com/ant-design/ant-design/issues/39115#issuecomment-1362314574
|
|
|
|
[`${componentCls}-title, ${componentCls}-header`]: {
|
2022-06-02 18:47:14 +08:00
|
|
|
borderRadius: `${tableRadius}px ${tableRadius}px 0 0`,
|
2022-05-31 10:10:35 +08:00
|
|
|
},
|
|
|
|
|
2022-09-02 20:57:53 +08:00
|
|
|
[`${componentCls}-title + ${componentCls}-container`]: {
|
2022-05-31 10:10:35 +08:00
|
|
|
borderStartStartRadius: 0,
|
|
|
|
borderStartEndRadius: 0,
|
|
|
|
|
2022-07-29 15:56:11 +08:00
|
|
|
table: {
|
|
|
|
borderRadius: 0,
|
2022-05-31 10:10:35 +08:00
|
|
|
|
2022-07-29 15:56:11 +08:00
|
|
|
'> thead > tr:first-child': {
|
|
|
|
'th:first-child': {
|
|
|
|
borderRadius: 0,
|
|
|
|
},
|
|
|
|
|
|
|
|
'th:last-child': {
|
|
|
|
borderRadius: 0,
|
|
|
|
},
|
2022-05-31 10:10:35 +08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
'&-container': {
|
2022-06-02 18:47:14 +08:00
|
|
|
borderStartStartRadius: tableRadius,
|
|
|
|
borderStartEndRadius: tableRadius,
|
2022-05-31 10:10:35 +08:00
|
|
|
|
|
|
|
'table > thead > tr:first-child': {
|
2022-12-24 14:14:07 +08:00
|
|
|
'> *:first-child': {
|
2022-06-02 18:47:14 +08:00
|
|
|
borderStartStartRadius: tableRadius,
|
2022-05-31 10:10:35 +08:00
|
|
|
},
|
|
|
|
|
2022-12-24 14:14:07 +08:00
|
|
|
'> *:last-child': {
|
2022-06-02 18:47:14 +08:00
|
|
|
borderStartEndRadius: tableRadius,
|
2022-05-31 10:10:35 +08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
'&-footer': {
|
2022-06-02 18:47:14 +08:00
|
|
|
borderRadius: `0 0 ${tableRadius}px ${tableRadius}px`,
|
2022-05-31 10:10:35 +08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
export default genRadiusStyle;
|