diff --git a/AGENTS.md b/AGENTS.md index e0f33d9809..70a43cfe54 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -272,6 +272,20 @@ export function TestComp(props) { - 新的属性需要声明可用的版本号 - 属性命名符合 antd 的 API 命名规则 +### 文档锚点 ID 规范 + +- 针对 Markdown 文件中的标题(# 到 ######)自动生成锚点 ID + - 所有中文标题(H1-H6)必须手动指定一个简洁、有意义的英文锚点。 + - 格式: ## 中文标题 {#english-anchor-id} + - 英文标题通常不需要手动指定锚点,但如果需要,可以使用相同的格式。 +- 锚点 ID 必须符合正则表达式 `^[a-zA-Z][\w-:\.]*$`, 且长度不应超过 32 个字符。 +- 用于演示(demo)且包含 `-demo-` 的 id 不受前面的长度限制。 +- FAQ 章节下的所有标题锚点必须以 `faq-` 作为前缀。 +- 为确保在不同语言间切换时锚点依然有效,同一问题的中英文锚点应保持完全一致。 + - 例如: + - 中文标题:`### 如何使用组件 {#how-to-use-component}` + - 英文标题:`### How to Use the Component {#how-to-use-component}` + ### Changelog 规范 - 在 CHANGELOG.en-US.md 和 CHANGELOG.zh-CN.md 书写每个版本的变更 diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index f3582c5d7e..b2d695dd95 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -182,7 +182,7 @@ tag: vVERSION - 💄 修复 DatePicker 文本颜色 token 错误的问题。[#55065](https://github.com/ant-design/ant-design/pull/55065) [@765477020](https://github.com/765477020) - 💄 修复 List 启用边框时会内容溢出的问题。[#55075](https://github.com/ant-design/ant-design/pull/55075) [@Jiyur](https://github.com/Jiyur) - ⌨️ 修复 Modal.confirm 缺失 `aria-labelledby` 可访问性属性的问题。[#55266](https://github.com/ant-design/ant-design/pull/55266) [@Jiyur](https://github.com/Jiyur) -- ⚡️ 优化 Cascader loading 图标的渲染。[#55285](https://github.com/ant-design/ant-design/pull/55285) [@li-jia-nan](https://github.com/li-jia-nan) +- ⚡️ 优化 Cascader 加载中图标的渲染。[#55285](https://github.com/ant-design/ant-design/pull/55285) [@li-jia-nan](https://github.com/li-jia-nan) - TypeScript - 🤖 修复 FloatButton `disabled` 属性类型缺失的问题。[#55156](https://github.com/ant-design/ant-design/pull/55156) [@deathemperor](https://github.com/deathemperor) diff --git a/components/config-provider/context.ts b/components/config-provider/context.ts index 63ad7eb8e2..907b7148ea 100644 --- a/components/config-provider/context.ts +++ b/components/config-provider/context.ts @@ -474,7 +474,7 @@ export interface ConfigComponentProps { } export interface ConfigConsumerProps extends ConfigComponentProps { - getTargetContainer?: () => HTMLElement; + getTargetContainer?: () => HTMLElement | Window; getPopupContainer?: (triggerNode?: HTMLElement) => HTMLElement; rootPrefixCls?: string; iconPrefixCls: string; diff --git a/components/config-provider/index.en-US.md b/components/config-provider/index.en-US.md index bf98515d16..23543422b9 100644 --- a/components/config-provider/index.en-US.md +++ b/components/config-provider/index.en-US.md @@ -56,8 +56,8 @@ Some components use dynamic style to support wave effect. You can config `csp` p | componentSize | Config antd component size | `small` \| `middle` \| `large` | - | | | csp | Set [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) config | { nonce: string } | - | | | direction | Set direction of layout. See [demo](#config-provider-demo-direction) | `ltr` \| `rtl` | `ltr` | | -| getPopupContainer | To set the container of the popup element. The default is to create a `div` element in `body` | function(triggerNode) | () => document.body | | -| getTargetContainer | Config Affix, Anchor scroll target container | () => HTMLElement | () => window | 4.2.0 | +| getPopupContainer | To set the container of the popup element. The default is to create a `div` element in `body` | `(trigger?: HTMLElement) => HTMLElement \| ShadowRoot` | () => document.body | | +| getTargetContainer | Config Affix, Anchor scroll target container | `() => HTMLElement \| Window \| ShadowRoot` | () => window | 4.2.0 | | iconPrefixCls | Set icon prefix className | string | `anticon` | 4.11.0 | | locale | Language package setting, you can find the packages in [antd/locale](http://unpkg.com/antd/locale/) | object | - | | | popupMatchSelectWidth | Determine whether the dropdown menu and the select input are the same width. Default set `min-width` same as input. Will ignore when value less than select width. `false` will disable virtual scroll | boolean \| number | - | 5.5.0 | diff --git a/components/config-provider/index.tsx b/components/config-provider/index.tsx index 9b7359e2b4..ae40b691ed 100644 --- a/components/config-provider/index.tsx +++ b/components/config-provider/index.tsx @@ -152,8 +152,8 @@ const PASSED_PROPS: Exclude< ]; export interface ConfigProviderProps { - getTargetContainer?: () => HTMLElement | Window; - getPopupContainer?: (triggerNode?: HTMLElement) => HTMLElement; + getTargetContainer?: () => HTMLElement | Window | ShadowRoot; + getPopupContainer?: (triggerNode?: HTMLElement) => HTMLElement | ShadowRoot; prefixCls?: string; iconPrefixCls?: string; children?: React.ReactNode; diff --git a/components/config-provider/index.zh-CN.md b/components/config-provider/index.zh-CN.md index 146481ba87..ee0ceb8940 100644 --- a/components/config-provider/index.zh-CN.md +++ b/components/config-provider/index.zh-CN.md @@ -57,8 +57,8 @@ export default Demo; | componentSize | 设置 antd 组件大小 | `small` \| `middle` \| `large` | - | | | csp | 设置 [Content Security Policy](https://developer.mozilla.org/zh-CN/docs/Web/HTTP/CSP) 配置 | { nonce: string } | - | | | direction | 设置文本展示方向。 [示例](#config-provider-demo-direction) | `ltr` \| `rtl` | `ltr` | | -| getPopupContainer | 弹出框(Select, Tooltip, Menu 等等)渲染父节点,默认渲染到 body 上。 | function(triggerNode) | () => document.body | | -| getTargetContainer | 配置 Affix、Anchor 滚动监听容器。 | () => HTMLElement | () => window | 4.2.0 | +| getPopupContainer | 弹出框(Select, Tooltip, Menu 等等)渲染父节点,默认渲染到 body 上。 | `(trigger?: HTMLElement) => HTMLElement \| ShadowRoot` | () => document.body | | +| getTargetContainer | 配置 Affix、Anchor 滚动监听容器。 | `() => HTMLElement \| Window \| ShadowRoot` | () => window | 4.2.0 | | iconPrefixCls | 设置图标统一样式前缀 | string | `anticon` | 4.11.0 | | locale | 语言包配置,语言包可到 [antd/locale](http://unpkg.com/antd/locale/) 目录下寻找 | object | - | | | popupMatchSelectWidth | 下拉菜单和选择器同宽。默认将设置 `min-width`,当值小于选择框宽度时会被忽略。`false` 时会关闭虚拟滚动 | boolean \| number | - | 5.5.0 | diff --git a/components/image/__tests__/index.test.tsx b/components/image/__tests__/index.test.tsx index 3939c8dd2d..252c32244e 100644 --- a/components/image/__tests__/index.test.tsx +++ b/components/image/__tests__/index.test.tsx @@ -73,7 +73,9 @@ describe('Image', () => { const { container, baseElement } = render( <>
-