From 2a21f7ba884ad7c2506fe7732068a83428cde009 Mon Sep 17 00:00:00 2001 From: EmilyyyLiu <100924403+EmilyyyLiu@users.noreply.github.com> Date: Thu, 2 Jan 2025 11:06:35 +0800 Subject: [PATCH] feat:[Tree] selected background color is gray when the node is disabled (#52173) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat:[Tree]对不可check的文本,select时候背景色改为灰色 * feat:[Tree] 修改disabled 选中的文本背景颜色 * feat: 对整行disable 的文本调整select背景色 * fix:恢复误改内容 * feat:删除不需要的多增加的注释内容 * feat:合并css选择器 * feat:更新 Tree snapshot * feat:删除不需要的提交 --------- Co-authored-by: 刘欢 Co-authored-by: afc163 --- .../__tests__/__snapshots__/demo-extend.test.ts.snap | 12 ++++++------ .../tree/__tests__/__snapshots__/demo.test.ts.snap | 12 ++++++------ components/tree/demo/basic.tsx | 2 +- components/tree/demo/component-token.tsx | 2 +- components/tree/demo/directory-debug.tsx | 6 +++--- components/tree/demo/multiple-line.tsx | 2 +- components/tree/style/index.ts | 7 ++++++- 7 files changed, 24 insertions(+), 19 deletions(-) diff --git a/components/tree/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/tree/__tests__/__snapshots__/demo-extend.test.ts.snap index 4ce730ac2af6..0932e06cc479 100644 --- a/components/tree/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/tree/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -90,7 +90,7 @@ exports[`renders components/tree/demo/basic.tsx extend context correctly 1`] = `
{ { ; -const NormalCheckDemo = () => ; +const NormalCheckDemo = () => ; const NormalDragDemo = () => ; diff --git a/components/tree/demo/multiple-line.tsx b/components/tree/demo/multiple-line.tsx index d7db44abf9a9..4c7c8518c65e 100644 --- a/components/tree/demo/multiple-line.tsx +++ b/components/tree/demo/multiple-line.tsx @@ -45,7 +45,7 @@ const App: React.FC = () => { nodeSelectedBg, nodeHoverBg, colorTextQuaternary, + controlItemBgActiveDisabled, } = token; - return { [treeCls]: { ...resetComponent(token), @@ -199,6 +199,11 @@ export const genBaseStyle = (prefixCls: string, token: TreeToken): CSSObject => }, }, + [`${treeCls}-checkbox-disabled + ${treeCls}-node-selected,&${treeNodeCls}-disabled${treeNodeCls}-selected ${treeCls}-node-content-wrapper`]: + { + backgroundColor: controlItemBgActiveDisabled, + }, + // not disable [`&:not(${treeNodeCls}-disabled)`]: { // >>> Title