Revert "feat: Tree add indentWidth token" (#51009)

This commit is contained in:
afc163 2024-09-25 11:14:36 +08:00 committed by GitHub
parent 9c3478ed77
commit d85d99df5e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 22 deletions

View File

@ -48,7 +48,6 @@ const App: React.FC = () => {
Tree: {
nodeHoverBg: '#fff2f0',
nodeSelectedBg: '#ffa39e',
indentWidth: 80,
},
},
}}

View File

@ -13,11 +13,6 @@ export interface TreeSharedToken {
* @descEN Node title height
*/
titleHeight: number;
/**
* @desc
* @descEN Indent width of tree
*/
indentWidth?: number;
/**
* @desc
* @descEN Background color of hovered node
@ -99,15 +94,7 @@ type TreeToken = FullToken<'Tree'> & {
};
export const genBaseStyle = (prefixCls: string, token: TreeToken): CSSObject => {
const {
treeCls,
treeNodeCls,
treeNodePadding,
titleHeight,
indentWidth,
nodeSelectedBg,
nodeHoverBg,
} = token;
const { treeCls, treeNodeCls, treeNodePadding, titleHeight, nodeSelectedBg, nodeHoverBg } = token;
const treeCheckBoxMarginHorizontal = token.paddingXS;
return {
@ -236,7 +223,7 @@ export const genBaseStyle = (prefixCls: string, token: TreeToken): CSSObject =>
userSelect: 'none',
'&-unit': {
display: 'inline-block',
width: indentWidth,
width: titleHeight,
},
},
@ -547,14 +534,12 @@ export const genTreeStyle = (
};
export const initComponentToken = (token: AliasToken): TreeSharedToken => {
const { controlHeightSM, controlItemBgHover, controlItemBgActive } = token;
const titleHeight = controlHeightSM;
const { controlHeightSM } = token;
return {
titleHeight,
indentWidth: titleHeight,
nodeHoverBg: controlItemBgHover,
nodeSelectedBg: controlItemBgActive,
titleHeight: controlHeightSM,
nodeHoverBg: token.controlItemBgHover,
nodeSelectedBg: token.controlItemBgActive,
};
};