Skip to content
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
ff51853
style(ProLayout): 侧栏收起时菜单标题区不再水平居中过渡
cursoragent Apr 13, 2026
d154b48
feat(ProLayout): 侧栏收起宽度动画结束后再居中菜单图标
cursoragent Apr 13, 2026
21fb3a0
fix: 修复 father 站点构建的 TypeScript 声明问题
cursoragent Apr 13, 2026
64ef648
fix(ProLayout): 收起侧栏菜单图标不再居中
cursoragent Apr 13, 2026
5e988d0
fix(ProLayout): 侧栏菜单项字号固定为 14px
cursoragent Apr 13, 2026
df03f45
feat(ProLayout): 子菜单标题增加展开指示图标
cursoragent Apr 13, 2026
bcdf813
fix(ProLayout): 收起菜单去掉多余包裹并收紧标题宽度
cursoragent Apr 13, 2026
e8d0b36
feat(ProLayout): 内联子菜单展开收起增加高度过渡动画
cursoragent Apr 13, 2026
fd8f9c8
fix(ProLayout): 垂直收起菜单项标题高度改为 auto
cursoragent Apr 13, 2026
f5df8c6
fix(ProLayout): 顶栏 horizontal 子菜单不展示展开箭头
cursoragent Apr 13, 2026
f854814
refactor(ProLayout): 主导航仅保留 vertical 与 horizontal
cursoragent Apr 13, 2026
3dad266
fix(ProLayout): 顶栏弹出菜单支持多级展开与面板内点击
cursoragent Apr 13, 2026
eca9c70
fix(ProLayout): 修复侧栏双 vertical 菜单样式注册 path 冲突
cursoragent Apr 13, 2026
4c2bce8
feat(ProLayout): 顶栏菜单 hover 打开子菜单并强化 hover 样式
cursoragent Apr 13, 2026
87c6cfa
feat(ProLayout): 顶栏与收起侧栏子菜单改用 Popover
cursoragent Apr 13, 2026
58ad339
fix(ProLayout): Popover 子菜单修复样式与浮层内点击
cursoragent Apr 13, 2026
87259de
fix(ProLayout): Popover 浮层内容包裹菜单根类名以继承 cssinjs 样式
cursoragent Apr 13, 2026
f5ad651
fix(ProLayout): 顶栏 horizontal 菜单行高 28px 并与子菜单标题对齐
cursoragent Apr 13, 2026
85ce0e0
fix(ProLayout): 顶栏菜单文案与图标垂直居中对齐
cursoragent Apr 13, 2026
30694d7
fix(ProLayout): 顶栏 Popover 浮层不再挂 --horizontal 避免子项被误样式
cursoragent Apr 13, 2026
50f1421
feat(ProLayout): 选中菜单项底部指示条展开动画
cursoragent Apr 13, 2026
c2128aa
fix(ProLayout): 侧栏收起时浮层内隐藏子菜单展开箭头
cursoragent Apr 13, 2026
c3e4f2e
fix(ProLayout): 选中菜单项去掉下划线改为外环高亮
cursoragent Apr 13, 2026
fed4d24
fix(ProLayout): 选中项仅保留背景与文字色,去掉外环
cursoragent Apr 13, 2026
8faaa5f
fix(ProLayout): 子菜单 Popover 浮层关闭箭头
cursoragent Apr 13, 2026
fc697e3
fix(layout): 侧栏展开时恢复子菜单展开指示器,收起时隐藏
cursoragent Apr 13, 2026
edee2a2
Merge branch 'master' into cursor/collapsed-icon-no-center-f5cc
chenshuai2144 Apr 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/form/components/ColorPicker/index.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import type { PopoverProps, ColorPickerProps } from 'antd';
import type { PopoverProps } from 'antd';
import React from 'react';
import { FieldColorPicker } from '../../../field';
import { ProConfigProvider } from '../../../provider';
import type { ProFormFieldItemProps } from '../../typing';
import ProFromField from '../Field';

export type ProFormColorPickerProps =
ProFormFieldItemProps<ColorPickerProps> & {
popoverProps?: PopoverProps;
colors?: string[];
};
/** 使用宽松字段类型,避免 d.ts 生成时拉入 `@rc-component/color-picker` 导致 TS2742 */
export type ProFormColorPickerProps = ProFormFieldItemProps<
Record<string, unknown>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using Record<string, unknown> for ProFormColorPickerProps removes type safety for the component's fieldProps. While this is intended to avoid TS2742 errors during declaration emission, it's a significant trade-off for a library. Consider if a more specific local type or using import type more effectively could resolve the emission issue without losing type safety for consumers.

> & {
popoverProps?: PopoverProps;
colors?: string[];
};
Comment on lines +8 to +14
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is described as a menu DOM/submenu indicator fix, but it also changes the exported ProFormColorPickerProps type (dropping ColorPickerProps in favor of Record<string, unknown>). Since this affects the public form API and type-safety, it should be called out explicitly in the PR description/changelog (or split into a separate PR) so reviewers and consumers understand the impact.

Copilot uses AI. Check for mistakes.

/**
* 颜色选择组件
Expand Down
38 changes: 34 additions & 4 deletions src/layout/components/SiderMenu/BaseMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { useControlledState } from '@rc-component/util';
import { ConfigProvider, Skeleton, Tooltip } from 'antd';
import { clsx } from 'clsx';
import React, {
cloneElement,
isValidElement,
useCallback,
useContext,
useEffect,
Expand Down Expand Up @@ -55,6 +57,34 @@ const MenuItemTooltip = (props: {
return props.children as React.JSX.Element;
}

/** 展开或过渡中:不包 Tooltip,避免多一层触发器 DOM */
if (!props.collapsed) {
return <>{props.children}</>;
}

const simpleTitle =
typeof props.title === 'string' || typeof props.title === 'number';

if (simpleTitle && isValidElement(props.children)) {
const t = String(props.title);
return cloneElement(props.children, {
title: t,
'aria-label': t,
} as React.HTMLAttributes<HTMLElement>);
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

if (simpleTitle) {
return (
<span
data-pro-layout-menu-item-title-wrap
title={String(props.title)}
aria-label={String(props.title)}
>
{props.children}
</span>
);
}

return (
<Tooltip
title={props.title}
Expand Down Expand Up @@ -679,7 +709,7 @@ const BaseMenu: React.FC<BaseMenuProps & PrivateSiderMenuProps> = (props) => {
return (
<div
style={
mode?.includes('inline')
mode !== 'horizontal'
? { padding: 24 }
: {
marginBlockStart: 16,
Expand All @@ -690,7 +720,7 @@ const BaseMenu: React.FC<BaseMenuProps & PrivateSiderMenuProps> = (props) => {
active
title={false}
paragraph={{
rows: mode?.includes('inline') ? 6 : 1,
rows: mode !== 'horizontal' ? 6 : 1,
}}
/>
</div>
Expand All @@ -715,7 +745,7 @@ const BaseMenu: React.FC<BaseMenuProps & PrivateSiderMenuProps> = (props) => {
const { className: menuPropsClassName, style: menuPropsStyle, ...restMenuProps } =
props.menuProps || {};

const inlineOpenKeys =
const navOpenKeys =
propsOpenKeys === false
? []
: openKeys === false
Expand All @@ -730,7 +760,7 @@ const BaseMenu: React.FC<BaseMenuProps & PrivateSiderMenuProps> = (props) => {
mode={mode!}
collapsed={props.collapsed}
selectedKeys={(selectedKeys || []).map((k) => String(k))}
openKeys={inlineOpenKeys}
openKeys={navOpenKeys}
defaultOpenKeys={defaultOpenKeysRef.current.map((k) => String(k))}
nodes={menuUtils.getNavMenuItems(finallyData, 0, 0)}
onOpenChange={(_openKeys) => {
Expand Down
Loading
Loading