mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-16 01:41:02 +08:00
3c3cda01e0
* ✨ feat: new tag
* update demo
* update snap
* fix
* fix
* fix
* fix
* fix
* fix
* fix style
* update snap
* revert
* fix
* fix
* fix
* fix
* fix
* Update components/select/style/multiple.tsx
Co-authored-by: MadCcc <1075746765@qq.com>
---------
Co-authored-by: MadCcc <1075746765@qq.com>
72 lines
2.3 KiB
TypeScript
72 lines
2.3 KiB
TypeScript
import { getStyle as getCheckboxStyle } from '../../checkbox/style';
|
|
import type { AliasToken, FullToken, GenerateStyle } from '../../theme/internal';
|
|
import { genComponentStyleHook, mergeToken } from '../../theme/internal';
|
|
import { genTreeStyle } from '../../tree/style';
|
|
|
|
interface TreeSelectToken extends FullToken<'TreeSelect'> {
|
|
treePrefixCls: string;
|
|
}
|
|
|
|
// =============================== Base ===============================
|
|
const genBaseStyle: GenerateStyle<TreeSelectToken> = (token) => {
|
|
const { componentCls, treePrefixCls, colorBgElevated } = token;
|
|
const treeCls = `.${treePrefixCls}`;
|
|
|
|
return [
|
|
// ======================================================
|
|
// == Dropdown ==
|
|
// ======================================================
|
|
{
|
|
[`${componentCls}-dropdown`]: [
|
|
{
|
|
padding: `${token.paddingXS}px ${token.paddingXS / 2}px`,
|
|
},
|
|
|
|
// ====================== Tree ======================
|
|
genTreeStyle(
|
|
treePrefixCls,
|
|
mergeToken<AliasToken>(token, { colorBgContainer: colorBgElevated }),
|
|
),
|
|
{
|
|
[treeCls]: {
|
|
borderRadius: 0,
|
|
'&-list-holder-inner': {
|
|
alignItems: 'stretch',
|
|
|
|
[`${treeCls}-treenode`]: {
|
|
[`${treeCls}-node-content-wrapper`]: {
|
|
flex: 'auto',
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
|
|
// ==================== Checkbox ====================
|
|
getCheckboxStyle(`${treePrefixCls}-checkbox`, token),
|
|
|
|
// ====================== RTL =======================
|
|
{
|
|
'&-rtl': {
|
|
direction: 'rtl',
|
|
|
|
[`${treeCls}-switcher${treeCls}-switcher_close`]: {
|
|
[`${treeCls}-switcher-icon svg`]: {
|
|
transform: 'rotate(90deg)',
|
|
},
|
|
},
|
|
},
|
|
},
|
|
],
|
|
},
|
|
];
|
|
};
|
|
|
|
// ============================== Export ==============================
|
|
export default function useTreeSelectStyle(prefixCls: string, treePrefixCls: string) {
|
|
return genComponentStyleHook('TreeSelect', (token) => {
|
|
const treeSelectToken = mergeToken<TreeSelectToken>(token, { treePrefixCls });
|
|
return [genBaseStyle(treeSelectToken)];
|
|
})(prefixCls);
|
|
}
|