1 line
11 KiB
JSON
1 line
11 KiB
JSON
|
{"ast":null,"code":"import { unit } from '@ant-design/cssinjs';\nimport { operationUnit } from '../../style';\nconst genExpandStyle = token => {\n const {\n componentCls,\n antCls,\n motionDurationSlow,\n lineWidth,\n paddingXS,\n lineType,\n tableBorderColor,\n tableExpandIconBg,\n tableExpandColumnWidth,\n borderRadius,\n tablePaddingVertical,\n tablePaddingHorizontal,\n tableExpandedRowBg,\n paddingXXS,\n expandIconMarginTop,\n expandIconSize,\n expandIconHalfInner,\n expandIconScale,\n calc\n } = token;\n const tableBorder = `${unit(lineWidth)} ${lineType} ${tableBorderColor}`;\n const expandIconLineOffset = calc(paddingXXS).sub(lineWidth).equal();\n return {\n [`${componentCls}-wrapper`]: {\n [`${componentCls}-expand-icon-col`]: {\n width: tableExpandColumnWidth\n },\n [`${componentCls}-row-expand-icon-cell`]: {\n textAlign: 'center',\n [`${componentCls}-row-expand-icon`]: {\n display: 'inline-flex',\n float: 'none',\n verticalAlign: 'sub'\n }\n },\n [`${componentCls}-row-indent`]: {\n height: 1,\n float: 'left'\n },\n [`${componentCls}-row-expand-icon`]: Object.assign(Object.assign({}, operationUnit(token)), {\n position: 'relative',\n float: 'left',\n boxSizing: 'border-box',\n width: expandIconSize,\n height: expandIconSize,\n padding: 0,\n color: 'inherit',\n lineHeight: unit(expandIconSize),\n background: tableExpandIconBg,\n border: tableBorder,\n borderRadius,\n transform: `scale(${expandIconScale})`,\n transition: `all ${motionDurationSlow}`,\n userSelect: 'none',\n '&:focus, &:hover, &:active': {\n borderColor: 'currentcolor'\n },\n '&::before, &::after': {\n position: 'absolute',\n background: 'currentcolor',\n transition: `transform ${motionDurationSlow} ease-out`,\n content: '\"\"'\n },\n '&::before': {\n top: expandIconHalfInner,\n insetInlineEnd: expandIconLineOffset,\n insetInlineStart: expandIconLineOffset,\n height: lineWidth\n },\n '&::after': {\n top: expandIconLineOffset,\n bottom: expandIconLineOffset,\n insetInlineStart: expandIconHalfInner,\n width: lineWidth,\n transform: 'rotate(90deg)'\n },\n // Motion effect\n '&-collapsed::before': {\n transform: 'rotate(-180deg)'\n },\n '&-collapsed::after': {\n transform: 'rotate(0deg)'\n },\n '&-spaced': {\n '&::before, &::after': {\n display: 'none',\n content: 'none'\n },\n background: 'transparent',\n border: 0,\n visibility: 'hidden'\n }\n }),\n [`${componentCls}-row-indent + ${componentCls}-row-expand-icon`]: {\n marginTop: expandIconMarginTop,\n marginInlineEnd: paddingXS\n },\n [`tr${componentCls}-expanded-row`]: {\n '&, &:hover': {\n '> th, > td': {\n background: tableExpandedRowBg\n }\n },\n // https://github.com/ant-design/ant-design/issues/25573\n [`${antCls}-descriptions-view`]: {\n display: 'flex',\n table: {\n flex: 'auto',\n width: '100%'\n }\n }\n },\n // With fixed\n [`${componentCls}-expanded-row-fixed`]: {\n position: 'relative',\n margin: `${unit(calc(tablePaddingVertical).mul(-1).equal())} ${unit(calc(tablePaddingHorizontal).mul(-1).equal())}`,\n padding: `${unit(tablePaddingVertical)} ${unit(tablePaddingHorizontal)}`\n }\n }\n };\n};\nexport default genExpandStyle;","map":{"version":3,"names":["unit","operationUnit","genExpandStyle","token","componentCls","antCls","motionDurationSlow","lineWidth","paddingXS","lineType","tableBorderColor","tableExpandIconBg","tableExpand
|