|
|
@ -1,10 +1,10 @@ |
|
|
|
import type { CSSInterpolation, CSSObject } from '@ant-design/cssinjs'; |
|
|
|
import { Keyframes } from '@ant-design/cssinjs'; |
|
|
|
import { genCollapseMotion } from '../../style/motion'; |
|
|
|
import { getStyle as getCheckboxStyle } from '../../checkbox/style'; |
|
|
|
import { genFocusOutline, resetComponent } from '../../style'; |
|
|
|
import { genCollapseMotion } from '../../style/motion'; |
|
|
|
import type { DerivativeToken } from '../../theme/internal'; |
|
|
|
import { genComponentStyleHook, mergeToken } from '../../theme/internal'; |
|
|
|
import { genFocusOutline, resetComponent } from '../../style'; |
|
|
|
|
|
|
|
// ============================ Keyframes =============================
|
|
|
|
const treeNodeFX = new Keyframes('ant-tree-node-fx-do-not-use', { |
|
|
@ -63,16 +63,7 @@ type TreeToken = DerivativeToken & { |
|
|
|
}; |
|
|
|
|
|
|
|
export const genBaseStyle = (prefixCls: string, token: TreeToken): CSSObject => { |
|
|
|
const { |
|
|
|
treeCls, |
|
|
|
treeNodeCls, |
|
|
|
controlInteractiveSize: checkboxSize, |
|
|
|
treeNodePadding, |
|
|
|
treeTitleHeight, |
|
|
|
} = token; |
|
|
|
// Ref: https://github.com/ant-design/ant-design/issues/41564
|
|
|
|
const checkBoxOffset = (token.lineHeight * token.fontSize) / 2 - checkboxSize / 2; |
|
|
|
const treeCheckBoxMarginVertical = (treeTitleHeight - token.fontSizeLG) / 2 - checkBoxOffset; |
|
|
|
const { treeCls, treeNodeCls, treeNodePadding, treeTitleHeight } = token; |
|
|
|
const treeCheckBoxMarginHorizontal = token.paddingXS; |
|
|
|
|
|
|
|
return { |
|
|
@ -269,7 +260,6 @@ export const genBaseStyle = (prefixCls: string, token: TreeToken): CSSObject => |
|
|
|
[`${treeCls}-checkbox`]: { |
|
|
|
top: 'initial', |
|
|
|
marginInlineEnd: treeCheckBoxMarginHorizontal, |
|
|
|
marginBlockStart: treeCheckBoxMarginVertical, |
|
|
|
}, |
|
|
|
|
|
|
|
// >>> Title
|
|
|
|