mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-30 12:28:33 +08:00
502dac12aa
* docs: fix code * feat: lint * feat: prettier * feat: test * feat: review * feat: format html * feat: format html
45 lines
1.3 KiB
TypeScript
45 lines
1.3 KiB
TypeScript
import { unit } from '@ant-design/cssinjs';
|
|
import type { CSSObject } from '@ant-design/cssinjs';
|
|
|
|
import { prepareComponentToken } from '.';
|
|
import type { CascaderToken } from '.';
|
|
import { genComponentStyleHook } from '../../theme/internal';
|
|
import type { GenerateStyle } from '../../theme/internal';
|
|
import getColumnsStyle from './columns';
|
|
|
|
// ============================== Panel ===============================
|
|
const genPanelStyle: GenerateStyle<CascaderToken> = (token: CascaderToken): CSSObject => {
|
|
const { componentCls } = token;
|
|
|
|
return {
|
|
[`${componentCls}-panel`]: [
|
|
getColumnsStyle(token),
|
|
{
|
|
display: 'inline-flex',
|
|
border: `${unit(token.lineWidth)} ${token.lineType} ${token.colorSplit}`,
|
|
borderRadius: token.borderRadiusLG,
|
|
overflowX: 'auto',
|
|
maxWidth: '100%',
|
|
|
|
[`${componentCls}-menus`]: {
|
|
alignItems: 'stretch',
|
|
},
|
|
[`${componentCls}-menu`]: {
|
|
height: 'auto',
|
|
},
|
|
|
|
'&-empty': {
|
|
padding: token.paddingXXS,
|
|
},
|
|
},
|
|
],
|
|
};
|
|
};
|
|
|
|
// ============================== Export ==============================
|
|
export default genComponentStyleHook(
|
|
['Cascader', 'Panel'],
|
|
(token) => genPanelStyle(token),
|
|
prepareComponentToken,
|
|
);
|