Compare commits

...

12 Commits

Author SHA1 Message Date
afc163
14f397749d chore: bump version to 5.29.3 and update changelogs (#56267) 2025-12-18 11:32:55 +08:00
Guo Yunhe
d36e6628ef fix(Breadcrumb): custom itemRender style for 5.x (#56251) 2025-12-17 17:00:00 +08:00
afc163
6dd5a234de chore: add 5.x-stable branch to github workflows (#56222) 2025-12-15 17:36:20 +08:00
afc163
2a6d0b837e chore: update branch references from master to 5.x-stable in scripts (#56218) 2025-12-15 16:02:26 +08:00
Wanpan
081e9a6311 fix(V5): Splitter ptg not fully cover (#56217)
Co-authored-by: 二货爱吃白萝卜 <smith3816@gmail.com>
fix: Splitter ptg not fully cover (#56025)
2025-12-15 12:08:23 +08:00
afc163
a811b7a702 docs: bump version to 5.29.2 and update changelogs (#56190)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-12-15 11:45:47 +08:00
afc163
34b32bb389 fix: notification wrong background color when cssVar is false (#56133) 2025-12-10 13:25:19 +08:00
Guo Yunhe
2a823ea79c fix(Breadcrumb): lift link style priority for v5 (#56139) 2025-12-10 13:21:16 +08:00
Copilot
6339b669e7 chore: cherry-pick changelog route fix from PR #56038 to 5.x-stable docs (#56138)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: 𝑾𝒖𝒙𝒉 <wxh1220@gmail.com>
2025-12-10 13:20:49 +08:00
𝑾𝒖𝒙𝒉
2e771318d0 docs: Add the link corresponding to the next major version of the cur… (#55946)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-11-27 15:50:04 +08:00
𝑾𝒖𝒙𝒉
bd10127ad0 docs(theme-editor): revert useLocalStorage to fix state update issue in Theme Editor (#55848) 2025-11-25 10:37:48 +08:00
二货爱吃白萝卜
5ebd3cb42f fix: Input.Search should not warning for addonAfter (#55806)
* docs: demo of Injector

* fix: Search should not warning
2025-11-22 12:56:13 +08:00
49 changed files with 805 additions and 489 deletions

View File

@@ -1,11 +1,10 @@
import React, { Suspense } from 'react';
import { App, Button, ConfigProvider, Skeleton } from 'antd';
import { App, Button, ConfigProvider, Skeleton, version } from 'antd';
import { enUS, zhCN } from 'antd-token-previewer';
import type { ThemeConfig } from 'antd/es/config-provider/context';
import { Helmet } from 'dumi';
import useLocale from '../../hooks/useLocale';
import useLocalStorage from '../../hooks/useLocalStorage';
const ThemeEditor = React.lazy(() => import('antd-token-previewer/lib/ThemeEditor'));
@@ -34,18 +33,24 @@ const locales = {
},
};
const ANT_THEME_EDITOR_THEME = 'ant-theme-editor-theme';
const [antdMajor] = version.split('.');
const ANT_DESIGN_V5_THEME_EDITOR_THEME = `ant-design-v${antdMajor}-theme-editor-theme`;
const CustomTheme: React.FC = () => {
const { message } = App.useApp();
const [locale, lang] = useLocale(locales);
const [themeConfig, setThemeConfig] = useLocalStorage<ThemeConfig>(ANT_THEME_EDITOR_THEME, {
defaultValue: {},
const [theme, setTheme] = React.useState<ThemeConfig>(() => {
try {
const storedConfig = localStorage.getItem(ANT_DESIGN_V5_THEME_EDITOR_THEME);
return storedConfig ? JSON.parse(storedConfig) : {};
} catch {
return {};
}
});
const handleSave = () => {
setThemeConfig(themeConfig);
localStorage.setItem(ANT_DESIGN_V5_THEME_EDITOR_THEME, JSON.stringify(theme));
message.success(locale.saveSuccessfully);
};
@@ -60,9 +65,11 @@ const CustomTheme: React.FC = () => {
<ThemeEditor
advanced
hideAdvancedSwitcher
theme={{ name: 'Custom Theme', key: 'test', config: themeConfig }}
theme={{ name: 'Custom Theme', key: 'test', config: theme }}
style={{ height: 'calc(100vh - 64px)' }}
onThemeChange={(newTheme) => setThemeConfig(newTheme.config)}
onThemeChange={(newTheme) => {
setTheme(newTheme.config);
}}
locale={lang === 'cn' ? zhCN : enUS}
actions={
<Button type="primary" onClick={handleSave}>

View File

@@ -48,7 +48,7 @@ const locales = {
},
};
const branchUrl = (repo: string) => `https://github.com/${repo}/edit/master/`;
const branchUrl = (repo: string) => `https://github.com/${repo}/edit/5.x-stable/`;
function isVersionNumber(value?: string) {
return value && /^\d+\.\d+\.\d+$/.test(value);
@@ -126,7 +126,7 @@ const ComponentMeta: React.FC<ComponentMetaProps> = (props) => {
if (String(source) === 'true') {
const kebabComponent = kebabCase(component);
return [
`https://github.com/${repo}/blob/master/components/${kebabComponent}`,
`https://github.com/${repo}/blob/5.x-stable/components/${kebabComponent}`,
`components/${kebabComponent}`,
];
}

View File

@@ -3,7 +3,7 @@ import { EditOutlined } from '@ant-design/icons';
import { Tooltip } from 'antd';
import { createStyles } from 'antd-style';
const branchUrl = 'https://github.com/ant-design/ant-design/edit/master/';
const branchUrl = 'https://github.com/ant-design/ant-design/edit/5.x-stable/';
export interface EditButtonProps {
title: React.ReactNode;

View File

@@ -157,21 +157,11 @@ const RoutesPlugin = async (api: IApi) => {
api.modifyRoutes((routes) => {
// TODO: append extra routes, such as home, changelog, form-v3
/**
* **important!** Make sure that the `id` and `path` are consistent.
* see: https://github.com/ant-design/ant-design/issues/55960
*/
const extraRoutesList: IRoute[] = [
{
id: 'changelog-cn',
path: 'changelog-cn',
absPath: '/changelog-cn',
parentId: 'DocLayout',
file: resolve('../../CHANGELOG.zh-CN.md'),
},
{
id: 'components-changelog-cn',
path: 'components/changelog-cn',
absPath: '/changelog-cn',
parentId: 'DocLayout',
file: resolve('../../CHANGELOG.zh-CN.md'),
},
{
id: 'changelog',
path: 'changelog',
@@ -180,12 +170,26 @@ const RoutesPlugin = async (api: IApi) => {
file: resolve('../../CHANGELOG.en-US.md'),
},
{
id: 'components-changelog',
id: 'changelog-cn',
path: 'changelog-cn',
absPath: '/changelog-cn',
parentId: 'DocLayout',
file: resolve('../../CHANGELOG.zh-CN.md'),
},
{
id: 'components/changelog',
path: 'components/changelog',
absPath: '/changelog',
absPath: '/components/changelog',
parentId: 'DocLayout',
file: resolve('../../CHANGELOG.en-US.md'),
},
{
id: 'components/changelog-cn',
path: 'components/changelog-cn',
absPath: '/components/changelog-cn',
parentId: 'DocLayout',
file: resolve('../../CHANGELOG.zh-CN.md'),
},
];
extraRoutesList.forEach((itemRoute) => {

View File

@@ -259,6 +259,7 @@ const Header: React.FC = () => {
const { menuVisible, windowWidth, searching } = headerState;
const docVersions: Record<string, string> = {
...themeConfig?.docNewVersions,
[pkg.version]: pkg.version,
...themeConfig?.docVersions,
};

View File

@@ -55,4 +55,7 @@ export default {
'0.10.x': 'https://010x.ant.design',
'0.9.x': 'https://09x.ant.design',
},
docNewVersions: {
'6.x': chineseMirror ? 'https://ant-design.antgroup.com' : 'https://ant.design',
},
};

View File

@@ -25,7 +25,7 @@ jobs:
with:
trigger: tag
changelogs: 'CHANGELOG.en-US.md, CHANGELOG.zh-CN.md'
branch: 'master, 4.x-stable'
branch: 'master, 5.x-stable, 4.x-stable'
tag: '5*, 4*'
latest: '5*'
dingding-token: ${{ secrets.DINGDING_BOT_TOKEN }} ${{ secrets.DINGDING_BOT_COLLABORATOR_TOKEN }} ${{ secrets.DINGDING_BOT_MAINTAINER_TOKEN }}
@@ -41,7 +41,7 @@ jobs:
with:
trigger: tag
changelogs: 'CHANGELOG.en-US.md, CHANGELOG.zh-CN.md'
branch: 'master, 4.x-stable'
branch: 'master, 5.x-stable, 4.x-stable'
tag: '5*, 4*'
latest: '5*'
dingding-token: ${{ secrets.DINGDING_BOT_BIGFISH_TOKEN }} ${{ secrets.DINGDING_BOT_BIGFISH_2_TOKEN }} ${{ secrets.DINGDING_BOT_YUNFENGDIE_TOKEN }}

View File

@@ -9,6 +9,7 @@ on:
- 2.x-stable
- 3.x-stable
- 4.x-stable
- 5.x-stable
create:
workflow_dispatch:

View File

@@ -4,9 +4,9 @@ name: ✅ test
on:
push:
branches: [master, feature]
branches: [master, feature, 5.x-stable]
pull_request:
branches: [master, feature]
branches: [master, feature, 5.x-stable]
# Cancel prev CI if new commit come
concurrency:
@@ -183,7 +183,7 @@ jobs:
# Artifact build files
- uses: actions/upload-artifact@v4
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
if: github.event_name == 'push' && github.ref == 'refs/heads/5.x-stable'
with:
name: build artifacts
path: |
@@ -193,7 +193,7 @@ jobs:
lib
- name: zip builds
if: github.repository == 'ant-design/ant-design' && github.event_name == 'push' && github.ref == 'refs/heads/master'
if: github.repository == 'ant-design/ant-design' && github.event_name == 'push' && github.ref == 'refs/heads/5.x-stable'
env:
ALI_OSS_AK_ID: ${{ secrets.ALI_OSS_AK_ID }}
ALI_OSS_AK_SECRET: ${{ secrets.ALI_OSS_AK_SECRET }}

View File

@@ -4,7 +4,7 @@ name: 👀 Visual Regression Diff Build
on:
pull_request:
branches: [master, feature, next]
branches: [master, feature, next, 5.x-stable]
types: [opened, synchronize, reopened]
# Cancel prev CI if new commit come

View File

@@ -8,7 +8,7 @@ name: 👀 Visual Regression Diff Start
on:
pull_request_target:
branches: [master, feature, next]
branches: [master, feature, next, 5.x-stable]
types: [opened, synchronize, reopened]
permissions:

View File

@@ -89,7 +89,7 @@ jobs:
path: ./tmp
- name: Persist Image Snapshot to OSS
if: github.repository == 'ant-design/ant-design' && github.event.workflow_run.event == 'push' && (github.event.workflow_run.head_branch == 'master' || github.event.workflow_run.head_branch == 'feature' || github.event.workflow_run.head_branch == 'next')
if: github.repository == 'ant-design/ant-design' && github.event.workflow_run.event == 'push' && (github.event.workflow_run.head_branch == 'master' || github.event.workflow_run.head_branch == 'feature' || github.event.workflow_run.head_branch == 'next' || github.event.workflow_run.head_branch == '5.x-stable')
env:
ALI_OSS_AK_ID: ${{ secrets.ALI_OSS_AK_ID }}
ALI_OSS_AK_SECRET: ${{ secrets.ALI_OSS_AK_SECRET }}

View File

@@ -8,6 +8,7 @@ on:
- master
- feature
- next
- 5.x-stable
permissions:
contents: read

View File

@@ -15,6 +15,21 @@ tag: vVERSION
---
## 5.29.3
`2025-12-18`
- 🐞 Fix Breadcrumb link color being overridden when using custom `itemRender`. [#56251](https://github.com/ant-design/ant-design/pull/56251) [@guoyunhe](https://github.com/guoyunhe)
## 5.29.2
`2025-12-15`
- 🐞 Fix notification background colors incorrect when `cssVar` is disabled. [#56133](https://github.com/ant-design/ant-design/pull/56133) [@afc163](https://github.com/afc163)
- 🐞 Raise Breadcrumb link style priority to avoid being overridden by global styles (v5). [#56139](https://github.com/ant-design/ant-design/pull/56139) [@guoyunhe](https://github.com/guoyunhe)
- 🐞 Fix Input.Search should not warn about deprecated `addonAfter`. [#55806](https://github.com/ant-design/ant-design/pull/55806) [@zombieJ](https://github.com/zombieJ)
- 🐞 Fix Splitter failing to fill its container when the sum of panel proportions is not 1. [#56217](https://github.com/ant-design/ant-design/pull/56217) [@zombieJ](https://github.com/zombieJ)
## 5.29.1
`2025-11-18`

View File

@@ -15,6 +15,21 @@ tag: vVERSION
---
## 5.29.3
`2025-12-18`
- 🐞 修复 Breadcrumb 自定义 `itemRender` 时链接颜色被覆盖的问题。[#56251](https://github.com/ant-design/ant-design/pull/56251) [@guoyunhe](https://github.com/guoyunhe)
## 5.29.2
`2025-12-15`
- 🐞 修复关闭 `cssVar` 时 notification 背景色异常的问题。[#56133](https://github.com/ant-design/ant-design/pull/56133) [@afc163](https://github.com/afc163)
- 🐞 提升 Breadcrumb 链接样式的优先级以避免被全局样式覆盖。[#56139](https://github.com/ant-design/ant-design/pull/56139) [@guoyunhe](https://github.com/guoyunhe)
- 🐞 修复 Input.Search 会报 `addonAfter` 已经废弃的警告信息的问题。[#55806](https://github.com/ant-design/ant-design/pull/55806) [@zombieJ](https://github.com/zombieJ)
- 🐞 修复 Splitter 在 Panel 总占比不为 1 时出现占不满的情况。 [#56217](https://github.com/ant-design/ant-design/pull/56217) [@zombieJ](https://github.com/zombieJ)
## 5.29.1
`2025-11-18`

View File

@@ -1096,11 +1096,7 @@ exports[`renders components/auto-complete/demo/certain-category.tsx extend conte
</div>
`;
exports[`renders components/auto-complete/demo/certain-category.tsx extend context correctly 2`] = `
[
"Warning: [antd: Input] \`addonAfter\` is deprecated. Please use \`Space.Compact\` instead.",
]
`;
exports[`renders components/auto-complete/demo/certain-category.tsx extend context correctly 2`] = `[]`;
exports[`renders components/auto-complete/demo/custom.tsx extend context correctly 1`] = `
<div
@@ -2428,7 +2424,6 @@ exports[`renders components/auto-complete/demo/form-debug.tsx extend context cor
exports[`renders components/auto-complete/demo/form-debug.tsx extend context correctly 2`] = `
[
"Warning: [antd: Input.Group] \`Input.Group\` is deprecated. Please use \`Space.Compact\` instead.",
"Warning: [antd: Input] \`addonAfter\` is deprecated. Please use \`Space.Compact\` instead.",
]
`;
@@ -2987,11 +2982,7 @@ exports[`renders components/auto-complete/demo/uncertain-category.tsx extend con
</div>
`;
exports[`renders components/auto-complete/demo/uncertain-category.tsx extend context correctly 2`] = `
[
"Warning: [antd: Input] \`addonAfter\` is deprecated. Please use \`Space.Compact\` instead.",
]
`;
exports[`renders components/auto-complete/demo/uncertain-category.tsx extend context correctly 2`] = `[]`;
exports[`renders components/auto-complete/demo/variant.tsx extend context correctly 1`] = `
<div

View File

@@ -94,7 +94,7 @@ export const InternalBreadcrumbItem: React.FC<BreadcrumbItemProps> = (props) =>
if (link !== undefined && link !== null) {
return (
<>
<li>{link}</li>
<li className={`${prefixCls}-item`}>{link}</li>
{separator && <BreadcrumbSeparator>{separator}</BreadcrumbSeparator>}
</>
);

View File

@@ -5,7 +5,9 @@ exports[`Breadcrumb filter React.Fragment 1`] = `
class="ant-breadcrumb"
>
<ol>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -18,7 +20,9 @@ exports[`Breadcrumb filter React.Fragment 1`] = `
>
:
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<a
class="ant-breadcrumb-link"
href=""
@@ -57,7 +61,9 @@ exports[`Breadcrumb should allow Breadcrumb.Item is null or undefined 1`] = `
class="ant-breadcrumb"
>
<ol>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -73,7 +79,9 @@ exports[`Breadcrumb should not display Breadcrumb Item when its children is fals
class="ant-breadcrumb"
>
<ol>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -86,7 +94,9 @@ exports[`Breadcrumb should not display Breadcrumb Item when its children is fals
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -102,7 +112,9 @@ exports[`Breadcrumb should render a menu 1`] = `
class="ant-breadcrumb"
>
<ol>
<li>
<li
class="ant-breadcrumb-item"
>
<a
class="ant-breadcrumb-link"
href="#/index"
@@ -116,7 +128,9 @@ exports[`Breadcrumb should render a menu 1`] = `
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-dropdown-trigger ant-breadcrumb-overlay-link"
>
@@ -153,7 +167,9 @@ exports[`Breadcrumb should render a menu 1`] = `
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<a
class="ant-breadcrumb-link"
href="#/index/first/second"
@@ -167,7 +183,9 @@ exports[`Breadcrumb should render a menu 1`] = `
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<a
class="ant-breadcrumb-link"
href="#/index/first/second/third"
@@ -182,7 +200,9 @@ exports[`Breadcrumb should render correct 1`] = `
class="ant-breadcrumb"
>
<ol>
<li>
<li
class="ant-breadcrumb-item"
>
<a
class="ant-breadcrumb-link"
href="#/"
@@ -198,7 +218,9 @@ exports[`Breadcrumb should render correct 1`] = `
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -214,7 +236,9 @@ exports[`Breadcrumb should support Breadcrumb.Item default separator 1`] = `
class="ant-breadcrumb"
>
<ol>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -228,7 +252,9 @@ exports[`Breadcrumb should support Breadcrumb.Item default separator 1`] = `
/
</li>
<span>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -242,7 +268,9 @@ exports[`Breadcrumb should support Breadcrumb.Item default separator 1`] = `
/
</li>
</span>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -258,7 +286,9 @@ exports[`Breadcrumb should support React.Fragment and falsy children 1`] = `
class="ant-breadcrumb"
>
<ol>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -271,7 +301,9 @@ exports[`Breadcrumb should support React.Fragment and falsy children 1`] = `
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -284,7 +316,9 @@ exports[`Breadcrumb should support React.Fragment and falsy children 1`] = `
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -308,7 +342,9 @@ exports[`Breadcrumb should support custom attribute 1`] = `
data-custom="custom"
>
<ol>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
data-custom="custom-item"
@@ -322,7 +358,9 @@ exports[`Breadcrumb should support custom attribute 1`] = `
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -338,7 +376,9 @@ exports[`Breadcrumb should support string \`0\` and number \`0\` 1`] = `
class="ant-breadcrumb"
>
<ol>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -351,7 +391,9 @@ exports[`Breadcrumb should support string \`0\` and number \`0\` 1`] = `
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>

View File

@@ -5,7 +5,9 @@ exports[`renders components/breadcrumb/demo/basic.tsx extend context correctly 1
class="ant-breadcrumb"
>
<ol>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -18,7 +20,9 @@ exports[`renders components/breadcrumb/demo/basic.tsx extend context correctly 1
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -35,7 +39,9 @@ exports[`renders components/breadcrumb/demo/basic.tsx extend context correctly 1
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -52,7 +58,9 @@ exports[`renders components/breadcrumb/demo/basic.tsx extend context correctly 1
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -70,7 +78,9 @@ exports[`renders components/breadcrumb/demo/component-token.tsx extend context c
class="ant-breadcrumb"
>
<ol>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -83,7 +93,9 @@ exports[`renders components/breadcrumb/demo/component-token.tsx extend context c
>
&gt;
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -100,7 +112,9 @@ exports[`renders components/breadcrumb/demo/component-token.tsx extend context c
>
&gt;
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-dropdown-trigger ant-breadcrumb-overlay-link"
>
@@ -267,7 +281,9 @@ exports[`renders components/breadcrumb/demo/component-token.tsx extend context c
>
&gt;
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<a
class="ant-breadcrumb-link"
href=""
@@ -281,7 +297,9 @@ exports[`renders components/breadcrumb/demo/component-token.tsx extend context c
>
&gt;
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<a
class="ant-breadcrumb-link"
href=""
@@ -313,7 +331,9 @@ exports[`renders components/breadcrumb/demo/component-token.tsx extend context c
>
&gt;
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<a
class="ant-breadcrumb-link"
href=""
@@ -353,7 +373,9 @@ exports[`renders components/breadcrumb/demo/debug-routes.tsx extend context corr
class="ant-breadcrumb"
>
<ol>
<li>
<li
class="ant-breadcrumb-item"
>
<a
class="ant-breadcrumb-link"
href="#/home"
@@ -367,7 +389,9 @@ exports[`renders components/breadcrumb/demo/debug-routes.tsx extend context corr
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-dropdown-trigger ant-breadcrumb-overlay-link"
>
@@ -499,7 +523,9 @@ exports[`renders components/breadcrumb/demo/overlay.tsx extend context correctly
class="ant-breadcrumb"
>
<ol>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -512,7 +538,9 @@ exports[`renders components/breadcrumb/demo/overlay.tsx extend context correctly
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -529,7 +557,9 @@ exports[`renders components/breadcrumb/demo/overlay.tsx extend context correctly
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-dropdown-trigger ant-breadcrumb-overlay-link"
>
@@ -696,7 +726,9 @@ exports[`renders components/breadcrumb/demo/overlay.tsx extend context correctly
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -714,7 +746,9 @@ exports[`renders components/breadcrumb/demo/separator.tsx extend context correct
class="ant-breadcrumb"
>
<ol>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -727,7 +761,9 @@ exports[`renders components/breadcrumb/demo/separator.tsx extend context correct
>
&gt;
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<a
class="ant-breadcrumb-link"
href=""
@@ -741,7 +777,9 @@ exports[`renders components/breadcrumb/demo/separator.tsx extend context correct
>
&gt;
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<a
class="ant-breadcrumb-link"
href=""
@@ -755,7 +793,9 @@ exports[`renders components/breadcrumb/demo/separator.tsx extend context correct
>
&gt;
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -773,7 +813,9 @@ exports[`renders components/breadcrumb/demo/separator-component.tsx extend conte
class="ant-breadcrumb"
>
<ol>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -786,7 +828,9 @@ exports[`renders components/breadcrumb/demo/separator-component.tsx extend conte
>
:
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<a
class="ant-breadcrumb-link"
href=""
@@ -800,7 +844,9 @@ exports[`renders components/breadcrumb/demo/separator-component.tsx extend conte
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<a
class="ant-breadcrumb-link"
href=""
@@ -814,7 +860,9 @@ exports[`renders components/breadcrumb/demo/separator-component.tsx extend conte
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -832,7 +880,9 @@ exports[`renders components/breadcrumb/demo/withIcon.tsx extend context correctl
class="ant-breadcrumb"
>
<ol>
<li>
<li
class="ant-breadcrumb-item"
>
<a
class="ant-breadcrumb-link"
href=""
@@ -864,7 +914,9 @@ exports[`renders components/breadcrumb/demo/withIcon.tsx extend context correctl
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<a
class="ant-breadcrumb-link"
href=""
@@ -899,7 +951,9 @@ exports[`renders components/breadcrumb/demo/withIcon.tsx extend context correctl
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -917,7 +971,9 @@ exports[`renders components/breadcrumb/demo/withParams.tsx extend context correc
class="ant-breadcrumb"
>
<ol>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -930,7 +986,9 @@ exports[`renders components/breadcrumb/demo/withParams.tsx extend context correc
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<a
class="ant-breadcrumb-link"
href=""

View File

@@ -5,7 +5,9 @@ exports[`renders components/breadcrumb/demo/basic.tsx correctly 1`] = `
class="ant-breadcrumb"
>
<ol>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -18,7 +20,9 @@ exports[`renders components/breadcrumb/demo/basic.tsx correctly 1`] = `
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -35,7 +39,9 @@ exports[`renders components/breadcrumb/demo/basic.tsx correctly 1`] = `
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -52,7 +58,9 @@ exports[`renders components/breadcrumb/demo/basic.tsx correctly 1`] = `
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -68,7 +76,9 @@ exports[`renders components/breadcrumb/demo/component-token.tsx correctly 1`] =
class="ant-breadcrumb"
>
<ol>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -81,7 +91,9 @@ exports[`renders components/breadcrumb/demo/component-token.tsx correctly 1`] =
>
&gt;
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -98,7 +110,9 @@ exports[`renders components/breadcrumb/demo/component-token.tsx correctly 1`] =
>
&gt;
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-dropdown-trigger ant-breadcrumb-overlay-link"
>
@@ -138,7 +152,9 @@ exports[`renders components/breadcrumb/demo/component-token.tsx correctly 1`] =
>
&gt;
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<a
class="ant-breadcrumb-link"
href=""
@@ -152,7 +168,9 @@ exports[`renders components/breadcrumb/demo/component-token.tsx correctly 1`] =
>
&gt;
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<a
class="ant-breadcrumb-link"
href=""
@@ -184,7 +202,9 @@ exports[`renders components/breadcrumb/demo/component-token.tsx correctly 1`] =
>
&gt;
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<a
class="ant-breadcrumb-link"
href=""
@@ -222,7 +242,9 @@ exports[`renders components/breadcrumb/demo/debug-routes.tsx correctly 1`] = `
class="ant-breadcrumb"
>
<ol>
<li>
<li
class="ant-breadcrumb-item"
>
<a
class="ant-breadcrumb-link"
href="#/home"
@@ -236,7 +258,9 @@ exports[`renders components/breadcrumb/demo/debug-routes.tsx correctly 1`] = `
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-dropdown-trigger ant-breadcrumb-overlay-link"
>
@@ -276,7 +300,9 @@ exports[`renders components/breadcrumb/demo/overlay.tsx correctly 1`] = `
class="ant-breadcrumb"
>
<ol>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -289,7 +315,9 @@ exports[`renders components/breadcrumb/demo/overlay.tsx correctly 1`] = `
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -306,7 +334,9 @@ exports[`renders components/breadcrumb/demo/overlay.tsx correctly 1`] = `
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-dropdown-trigger ant-breadcrumb-overlay-link"
>
@@ -346,7 +376,9 @@ exports[`renders components/breadcrumb/demo/overlay.tsx correctly 1`] = `
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -362,7 +394,9 @@ exports[`renders components/breadcrumb/demo/separator.tsx correctly 1`] = `
class="ant-breadcrumb"
>
<ol>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -375,7 +409,9 @@ exports[`renders components/breadcrumb/demo/separator.tsx correctly 1`] = `
>
&gt;
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<a
class="ant-breadcrumb-link"
href=""
@@ -389,7 +425,9 @@ exports[`renders components/breadcrumb/demo/separator.tsx correctly 1`] = `
>
&gt;
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<a
class="ant-breadcrumb-link"
href=""
@@ -403,7 +441,9 @@ exports[`renders components/breadcrumb/demo/separator.tsx correctly 1`] = `
>
&gt;
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -419,7 +459,9 @@ exports[`renders components/breadcrumb/demo/separator-component.tsx correctly 1`
class="ant-breadcrumb"
>
<ol>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -432,7 +474,9 @@ exports[`renders components/breadcrumb/demo/separator-component.tsx correctly 1`
>
:
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<a
class="ant-breadcrumb-link"
href=""
@@ -446,7 +490,9 @@ exports[`renders components/breadcrumb/demo/separator-component.tsx correctly 1`
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<a
class="ant-breadcrumb-link"
href=""
@@ -460,7 +506,9 @@ exports[`renders components/breadcrumb/demo/separator-component.tsx correctly 1`
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -476,7 +524,9 @@ exports[`renders components/breadcrumb/demo/withIcon.tsx correctly 1`] = `
class="ant-breadcrumb"
>
<ol>
<li>
<li
class="ant-breadcrumb-item"
>
<a
class="ant-breadcrumb-link"
href=""
@@ -508,7 +558,9 @@ exports[`renders components/breadcrumb/demo/withIcon.tsx correctly 1`] = `
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<a
class="ant-breadcrumb-link"
href=""
@@ -543,7 +595,9 @@ exports[`renders components/breadcrumb/demo/withIcon.tsx correctly 1`] = `
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -559,7 +613,9 @@ exports[`renders components/breadcrumb/demo/withParams.tsx correctly 1`] = `
class="ant-breadcrumb"
>
<ol>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -572,7 +628,9 @@ exports[`renders components/breadcrumb/demo/withParams.tsx correctly 1`] = `
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<a
class="ant-breadcrumb-link"
href=""

View File

@@ -6,7 +6,9 @@ exports[`Breadcrumb.ItemRender render as expect 1`] = `
class="ant-breadcrumb"
>
<ol>
<li>
<li
class="ant-breadcrumb-item"
>
<a
class="my-link"
data-path="/"
@@ -20,7 +22,9 @@ exports[`Breadcrumb.ItemRender render as expect 1`] = `
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<a
class="my-link"
data-path="/bamboo"

View File

@@ -5,7 +5,9 @@ exports[`react router react router legacy 1`] = `
class="ant-breadcrumb"
>
<ol>
<li>
<li
class="ant-breadcrumb-item"
>
<a
class="ant-breadcrumb-link"
href="#/"
@@ -19,7 +21,9 @@ exports[`react router react router legacy 1`] = `
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<a
class="ant-breadcrumb-link"
href="#//apps"
@@ -33,7 +37,9 @@ exports[`react router react router legacy 1`] = `
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<a
class="ant-breadcrumb-link"
href="#//apps/1"
@@ -47,7 +53,9 @@ exports[`react router react router legacy 1`] = `
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<a
class="ant-breadcrumb-link"
href="#//apps/1/detail"

View File

@@ -66,7 +66,7 @@ const genBreadcrumbStyle: GenerateStyle<BreadcrumbToken, CSSObject> = (token) =>
listStyle: 'none',
},
a: {
[`${componentCls}-item a`]: {
color: token.linkColor,
transition: `color ${token.motionDurationMid}`,
padding: `0 ${unit(token.paddingXXS)}`,
@@ -83,7 +83,7 @@ const genBreadcrumbStyle: GenerateStyle<BreadcrumbToken, CSSObject> = (token) =>
...genFocusStyle(token),
},
'li:last-child': {
[`${componentCls}-item:last-child`]: {
color: token.lastItemColor,
},

View File

@@ -2014,11 +2014,7 @@ Array [
]
`;
exports[`renders components/button/demo/debug-icon.tsx extend context correctly 2`] = `
[
"Warning: [antd: Input] \`addonAfter\` is deprecated. Please use \`Space.Compact\` instead.",
]
`;
exports[`renders components/button/demo/debug-icon.tsx extend context correctly 2`] = `[]`;
exports[`renders components/button/demo/disabled.tsx extend context correctly 1`] = `
<div

View File

@@ -1175,7 +1175,9 @@ exports[`ConfigProvider components Breadcrumb configProvider 1`] = `
class="config-breadcrumb"
>
<ol>
<li>
<li
class="config-breadcrumb-item"
>
<span
class="config-breadcrumb-link"
>
@@ -1188,7 +1190,9 @@ exports[`ConfigProvider components Breadcrumb configProvider 1`] = `
>
/
</li>
<li>
<li
class="config-breadcrumb-item"
>
<span
class="config-breadcrumb-link"
>
@@ -1204,7 +1208,9 @@ exports[`ConfigProvider components Breadcrumb configProvider componentDisabled 1
class="config-breadcrumb"
>
<ol>
<li>
<li
class="config-breadcrumb-item"
>
<span
class="config-breadcrumb-link"
>
@@ -1217,7 +1223,9 @@ exports[`ConfigProvider components Breadcrumb configProvider componentDisabled 1
>
/
</li>
<li>
<li
class="config-breadcrumb-item"
>
<span
class="config-breadcrumb-link"
>
@@ -1233,7 +1241,9 @@ exports[`ConfigProvider components Breadcrumb configProvider componentSize large
class="config-breadcrumb"
>
<ol>
<li>
<li
class="config-breadcrumb-item"
>
<span
class="config-breadcrumb-link"
>
@@ -1246,7 +1256,9 @@ exports[`ConfigProvider components Breadcrumb configProvider componentSize large
>
/
</li>
<li>
<li
class="config-breadcrumb-item"
>
<span
class="config-breadcrumb-link"
>
@@ -1262,7 +1274,9 @@ exports[`ConfigProvider components Breadcrumb configProvider componentSize middl
class="config-breadcrumb"
>
<ol>
<li>
<li
class="config-breadcrumb-item"
>
<span
class="config-breadcrumb-link"
>
@@ -1275,7 +1289,9 @@ exports[`ConfigProvider components Breadcrumb configProvider componentSize middl
>
/
</li>
<li>
<li
class="config-breadcrumb-item"
>
<span
class="config-breadcrumb-link"
>
@@ -1291,7 +1307,9 @@ exports[`ConfigProvider components Breadcrumb configProvider componentSize small
class="config-breadcrumb"
>
<ol>
<li>
<li
class="config-breadcrumb-item"
>
<span
class="config-breadcrumb-link"
>
@@ -1304,7 +1322,9 @@ exports[`ConfigProvider components Breadcrumb configProvider componentSize small
>
/
</li>
<li>
<li
class="config-breadcrumb-item"
>
<span
class="config-breadcrumb-link"
>
@@ -1320,7 +1340,9 @@ exports[`ConfigProvider components Breadcrumb normal 1`] = `
class="ant-breadcrumb"
>
<ol>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -1333,7 +1355,9 @@ exports[`ConfigProvider components Breadcrumb normal 1`] = `
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -1349,7 +1373,9 @@ exports[`ConfigProvider components Breadcrumb prefixCls 1`] = `
class="prefix-Breadcrumb"
>
<ol>
<li>
<li
class="prefix-Breadcrumb-item"
>
<span
class="prefix-Breadcrumb-link"
>
@@ -1362,7 +1388,9 @@ exports[`ConfigProvider components Breadcrumb prefixCls 1`] = `
>
/
</li>
<li>
<li
class="prefix-Breadcrumb-item"
>
<span
class="prefix-Breadcrumb-link"
>

View File

@@ -11917,9 +11917,7 @@ exports[`renders components/form/demo/register.tsx extend context correctly 1`]
class="ant-form-item-control-input-content"
>
<div
aria-required="true"
class="ant-space-compact ant-space-compact-block"
id="register_phone"
>
<div
class="ant-select ant-select-outlined ant-select-in-form-item ant-select-compact-item ant-select-compact-first-item ant-select-single ant-select-show-arrow"
@@ -12067,7 +12065,9 @@ exports[`renders components/form/demo/register.tsx extend context correctly 1`]
</span>
</div>
<input
aria-required="true"
class="ant-input ant-input-outlined ant-input-compact-item ant-input-compact-last-item"
id="register_phone"
style="width: 100%;"
type="text"
value=""
@@ -12105,9 +12105,7 @@ exports[`renders components/form/demo/register.tsx extend context correctly 1`]
class="ant-form-item-control-input-content"
>
<div
aria-required="true"
class="ant-space-compact ant-space-compact-block"
id="register_donation"
>
<div
class="ant-input-number ant-input-number-in-form-item ant-input-number-outlined ant-input-number-compact-item ant-input-number-compact-first-item"
@@ -12175,8 +12173,10 @@ exports[`renders components/form/demo/register.tsx extend context correctly 1`]
class="ant-input-number-input-wrap"
>
<input
aria-required="true"
autocomplete="off"
class="ant-input-number-input"
id="register_donation"
role="spinbutton"
step="1"
value=""

View File

@@ -7992,9 +7992,7 @@ exports[`renders components/form/demo/register.tsx correctly 1`] = `
class="ant-form-item-control-input-content"
>
<div
aria-required="true"
class="ant-space-compact ant-space-compact-block"
id="register_phone"
>
<div
class="ant-select ant-select-outlined ant-select-in-form-item ant-select-compact-item ant-select-compact-first-item ant-select-single ant-select-show-arrow"
@@ -8062,7 +8060,9 @@ exports[`renders components/form/demo/register.tsx correctly 1`] = `
</span>
</div>
<input
aria-required="true"
class="ant-input ant-input-outlined ant-input-compact-item ant-input-compact-last-item"
id="register_phone"
style="width:100%"
type="text"
value=""
@@ -8100,9 +8100,7 @@ exports[`renders components/form/demo/register.tsx correctly 1`] = `
class="ant-form-item-control-input-content"
>
<div
aria-required="true"
class="ant-space-compact ant-space-compact-block"
id="register_donation"
>
<div
class="ant-input-number ant-input-number-in-form-item ant-input-number-outlined ant-input-number-compact-item ant-input-number-compact-first-item"
@@ -8170,8 +8168,10 @@ exports[`renders components/form/demo/register.tsx correctly 1`] = `
class="ant-input-number-input-wrap"
>
<input
aria-required="true"
autocomplete="off"
class="ant-input-number-input"
id="register_donation"
role="spinbutton"
step="1"
value=""

View File

@@ -80,6 +80,10 @@ const tailFormItemLayout: FormItemProps = {
},
};
function Injector({ children, ...rest }: { children: (props: any) => React.ReactElement }) {
return children(rest);
}
const App: React.FC = () => {
const [form] = Form.useForm();
@@ -214,11 +218,14 @@ const App: React.FC = () => {
label="Phone Number"
rules={[{ required: true, message: 'Please input your phone number!' }]}
>
{/* Demo only, real usage should wrap as custom component */}
<Space.Compact block>
{prefixSelector}
<Input style={{ width: '100%' }} />
</Space.Compact>
<Injector>
{(props) => (
<Space.Compact block>
{prefixSelector}
<Input style={{ width: '100%' }} {...props} />
</Space.Compact>
)}
</Injector>
</Form.Item>
<Form.Item
@@ -226,11 +233,14 @@ const App: React.FC = () => {
label="Donation"
rules={[{ required: true, message: 'Please input donation amount!' }]}
>
{/* Demo only, real usage should wrap as custom component */}
<Space.Compact block>
<InputNumber style={{ width: '100%' }} />
{suffixSelector}
</Space.Compact>
<Injector>
{(props) => (
<Space.Compact block>
<InputNumber style={{ width: '100%' }} {...props} />
{suffixSelector}
</Space.Compact>
)}
</Injector>
</Form.Item>
<Form.Item

View File

@@ -77,6 +77,9 @@ export interface InputProps
classNames?: Partial<Record<SemanticName, string>>;
styles?: Partial<Record<SemanticName, React.CSSProperties>>;
[key: `data-${string}`]: string | undefined;
/** @private Skip warning of addon. Only work in dev mode */
_skipAddonWarning?: boolean;
}
const Input = forwardRef<InputRef, InputProps>((props, ref) => {
@@ -99,18 +102,22 @@ const Input = forwardRef<InputRef, InputProps>((props, ref) => {
onChange,
classNames,
variant: customVariant,
_skipAddonWarning,
...rest
} = props;
if (process.env.NODE_ENV !== 'production') {
const { deprecated } = devUseWarning('Input');
[
['bordered', 'variant'],
['addonAfter', 'Space.Compact'],
['addonBefore', 'Space.Compact'],
].forEach(([prop, newProp]) => {
deprecated(!(prop in props), prop, newProp);
});
deprecated(!('bordered' in props), 'bordered', 'variant');
if (!_skipAddonWarning) {
[
['addonAfter', 'Space.Compact'],
['addonBefore', 'Space.Compact'],
].forEach(([prop, newProp]) => {
deprecated(!(prop in props), prop, newProp);
});
}
}
const {

View File

@@ -185,6 +185,7 @@ const Search = React.forwardRef<InputRef, SearchProps>((props, ref) => {
suffix,
onChange,
disabled,
_skipAddonWarning: true,
};
return <Input ref={composeRef<InputRef>(inputRef, ref)} {...inputProps} />;

View File

@@ -1,6 +1,7 @@
import React from 'react';
import { fireEvent, render } from '@testing-library/react';
import { resetWarned } from '../../_util/warning';
import focusTest from '../../../tests/shared/focusTest';
import mountTest from '../../../tests/shared/mountTest';
import rtlTest from '../../../tests/shared/rtlTest';
@@ -13,6 +14,20 @@ describe('Input.Search', () => {
mountTest(Search);
rtlTest(Search);
beforeEach(() => {
resetWarned();
});
// V5 Only
it('no warning of addon', () => {
const errSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
render(<Search />);
expect(errSpy).not.toHaveBeenCalled();
errSpy.mockRestore();
});
it('should support custom button', () => {
const { asFragment } = render(<Search enterButton={<button type="button">ok</button>} />);
expect(asFragment().firstChild).toMatchSnapshot();

View File

@@ -6114,11 +6114,7 @@ exports[`renders components/input/demo/compact-style.tsx extend context correctl
</div>
`;
exports[`renders components/input/demo/compact-style.tsx extend context correctly 2`] = `
[
"Warning: [antd: Input] \`addonAfter\` is deprecated. Please use \`Space.Compact\` instead.",
]
`;
exports[`renders components/input/demo/compact-style.tsx extend context correctly 2`] = `[]`;
exports[`renders components/input/demo/debug-addon.tsx extend context correctly 1`] = `
<div
@@ -10310,7 +10306,6 @@ exports[`renders components/input/demo/group.tsx extend context correctly 1`] =
exports[`renders components/input/demo/group.tsx extend context correctly 2`] = `
[
"Warning: [antd: Input.Group] \`Input.Group\` is deprecated. Please use \`Space.Compact\` instead.",
"Warning: [antd: Input] \`addonAfter\` is deprecated. Please use \`Space.Compact\` instead.",
]
`;
@@ -11804,11 +11799,7 @@ exports[`renders components/input/demo/search-input.tsx extend context correctly
</div>
`;
exports[`renders components/input/demo/search-input.tsx extend context correctly 2`] = `
[
"Warning: [antd: Input] \`addonAfter\` is deprecated. Please use \`Space.Compact\` instead.",
]
`;
exports[`renders components/input/demo/search-input.tsx extend context correctly 2`] = `[]`;
exports[`renders components/input/demo/search-input-loading.tsx extend context correctly 1`] = `
Array [
@@ -11960,11 +11951,7 @@ Array [
]
`;
exports[`renders components/input/demo/search-input-loading.tsx extend context correctly 2`] = `
[
"Warning: [antd: Input] \`addonAfter\` is deprecated. Please use \`Space.Compact\` instead.",
]
`;
exports[`renders components/input/demo/search-input-loading.tsx extend context correctly 2`] = `[]`;
exports[`renders components/input/demo/show-count.tsx extend context correctly 1`] = `
<div
@@ -12468,8 +12455,4 @@ exports[`renders components/input/demo/variant.tsx extend context correctly 1`]
</div>
`;
exports[`renders components/input/demo/variant.tsx extend context correctly 2`] = `
[
"Warning: [antd: Input] \`addonAfter\` is deprecated. Please use \`Space.Compact\` instead.",
]
`;
exports[`renders components/input/demo/variant.tsx extend context correctly 2`] = `[]`;

View File

@@ -885,7 +885,9 @@ exports[`renders components/layout/demo/component-token.tsx extend context corre
style="margin: 16px 0px;"
>
<ol>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -898,7 +900,9 @@ exports[`renders components/layout/demo/component-token.tsx extend context corre
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -911,7 +915,9 @@ exports[`renders components/layout/demo/component-token.tsx extend context corre
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -1343,7 +1349,9 @@ exports[`renders components/layout/demo/fixed.tsx extend context correctly 1`] =
style="margin: 16px 0px;"
>
<ol>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -1356,7 +1364,9 @@ exports[`renders components/layout/demo/fixed.tsx extend context correctly 1`] =
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -1369,7 +1379,9 @@ exports[`renders components/layout/demo/fixed.tsx extend context correctly 1`] =
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -2843,7 +2855,9 @@ exports[`renders components/layout/demo/side.tsx extend context correctly 1`] =
style="margin: 16px 0px;"
>
<ol>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -2856,7 +2870,9 @@ exports[`renders components/layout/demo/side.tsx extend context correctly 1`] =
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -3432,7 +3448,9 @@ exports[`renders components/layout/demo/top.tsx extend context correctly 1`] = `
style="margin: 16px 0px;"
>
<ol>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -3445,7 +3463,9 @@ exports[`renders components/layout/demo/top.tsx extend context correctly 1`] = `
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -3458,7 +3478,9 @@ exports[`renders components/layout/demo/top.tsx extend context correctly 1`] = `
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -3660,7 +3682,9 @@ exports[`renders components/layout/demo/top-side.tsx extend context correctly 1`
style="margin: 16px 0px;"
>
<ol>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -3673,7 +3697,9 @@ exports[`renders components/layout/demo/top-side.tsx extend context correctly 1`
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -3686,7 +3712,9 @@ exports[`renders components/layout/demo/top-side.tsx extend context correctly 1`
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -5308,7 +5336,9 @@ exports[`renders components/layout/demo/top-side-2.tsx extend context correctly
style="margin: 16px 0px;"
>
<ol>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -5321,7 +5351,9 @@ exports[`renders components/layout/demo/top-side-2.tsx extend context correctly
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -5334,7 +5366,9 @@ exports[`renders components/layout/demo/top-side-2.tsx extend context correctly
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>

View File

@@ -380,7 +380,9 @@ exports[`renders components/layout/demo/component-token.tsx correctly 1`] = `
style="margin:16px 0"
>
<ol>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -393,7 +395,9 @@ exports[`renders components/layout/demo/component-token.tsx correctly 1`] = `
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -406,7 +410,9 @@ exports[`renders components/layout/demo/component-token.tsx correctly 1`] = `
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -705,7 +711,9 @@ exports[`renders components/layout/demo/fixed.tsx correctly 1`] = `
style="margin:16px 0"
>
<ol>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -718,7 +726,9 @@ exports[`renders components/layout/demo/fixed.tsx correctly 1`] = `
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -731,7 +741,9 @@ exports[`renders components/layout/demo/fixed.tsx correctly 1`] = `
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -1707,7 +1719,9 @@ exports[`renders components/layout/demo/side.tsx correctly 1`] = `
style="margin:16px 0"
>
<ol>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -1720,7 +1734,9 @@ exports[`renders components/layout/demo/side.tsx correctly 1`] = `
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -2014,7 +2030,9 @@ exports[`renders components/layout/demo/top.tsx correctly 1`] = `
style="margin:16px 0"
>
<ol>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -2027,7 +2045,9 @@ exports[`renders components/layout/demo/top.tsx correctly 1`] = `
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -2040,7 +2060,9 @@ exports[`renders components/layout/demo/top.tsx correctly 1`] = `
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -2176,7 +2198,9 @@ exports[`renders components/layout/demo/top-side.tsx correctly 1`] = `
style="margin:16px 0"
>
<ol>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -2189,7 +2213,9 @@ exports[`renders components/layout/demo/top-side.tsx correctly 1`] = `
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -2202,7 +2228,9 @@ exports[`renders components/layout/demo/top-side.tsx correctly 1`] = `
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -2752,7 +2780,9 @@ exports[`renders components/layout/demo/top-side-2.tsx correctly 1`] = `
style="margin:16px 0"
>
<ol>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -2765,7 +2795,9 @@ exports[`renders components/layout/demo/top-side-2.tsx correctly 1`] = `
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>
@@ -2778,7 +2810,9 @@ exports[`renders components/layout/demo/top-side-2.tsx correctly 1`] = `
>
/
</li>
<li>
<li
class="ant-breadcrumb-item"
>
<span
class="ant-breadcrumb-link"
>

View File

@@ -14,63 +14,43 @@ exports[`renders components/notification/demo/basic.tsx extend context correctly
exports[`renders components/notification/demo/basic.tsx extend context correctly 2`] = `[]`;
exports[`renders components/notification/demo/component-token.tsx extend context correctly 1`] = `
Array [
<h4>
Custom Theme (Enhanced Colors)
</h4>,
<div
class="ant-space ant-space-horizontal ant-space-align-center ant-space-gap-row-small ant-space-gap-col-small"
<div
class="ant-flex ant-flex-wrap-wrap"
style="gap: 8px;"
>
<button
class="ant-btn ant-btn-default ant-btn-color-green ant-btn-variant-outlined"
type="button"
>
<div
class="ant-space-item"
>
<button
class="ant-btn ant-btn-primary ant-btn-color-primary ant-btn-variant-solid"
type="button"
>
<span>
Custom Success
</span>
</button>
</div>
<div
class="ant-space-item"
>
<button
class="ant-btn ant-btn-default ant-btn-color-default ant-btn-variant-outlined"
type="button"
>
<span>
Custom Info
</span>
</button>
</div>
<div
class="ant-space-item"
>
<button
class="ant-btn ant-btn-default ant-btn-color-default ant-btn-variant-outlined"
type="button"
>
<span>
Custom Warning
</span>
</button>
</div>
<div
class="ant-space-item"
>
<button
class="ant-btn ant-btn-default ant-btn-dangerous ant-btn-color-dangerous ant-btn-variant-outlined"
type="button"
>
<span>
Custom Error
</span>
</button>
</div>
</div>,
]
<span>
Success
</span>
</button>
<button
class="ant-btn ant-btn-default ant-btn-color-blue ant-btn-variant-outlined"
type="button"
>
<span>
Info
</span>
</button>
<button
class="ant-btn ant-btn-default ant-btn-color-yellow ant-btn-variant-outlined"
type="button"
>
<span>
Warning
</span>
</button>
<button
class="ant-btn ant-btn-default ant-btn-color-red ant-btn-variant-outlined"
type="button"
>
<span>
Error
</span>
</button>
</div>
`;
exports[`renders components/notification/demo/component-token.tsx extend context correctly 2`] = `[]`;
@@ -819,56 +799,41 @@ exports[`renders components/notification/demo/with-btn.tsx extend context correc
exports[`renders components/notification/demo/with-icon.tsx extend context correctly 1`] = `
<div
class="ant-space ant-space-horizontal ant-space-align-center ant-space-gap-row-small ant-space-gap-col-small"
class="ant-flex ant-flex-wrap-wrap"
style="gap: 8px;"
>
<div
class="ant-space-item"
<button
class="ant-btn ant-btn-default ant-btn-color-green ant-btn-variant-outlined"
type="button"
>
<button
class="ant-btn ant-btn-default ant-btn-color-default ant-btn-variant-outlined"
type="button"
>
<span>
Success
</span>
</button>
</div>
<div
class="ant-space-item"
<span>
Success
</span>
</button>
<button
class="ant-btn ant-btn-default ant-btn-color-blue ant-btn-variant-outlined"
type="button"
>
<button
class="ant-btn ant-btn-default ant-btn-color-default ant-btn-variant-outlined"
type="button"
>
<span>
Info
</span>
</button>
</div>
<div
class="ant-space-item"
<span>
Info
</span>
</button>
<button
class="ant-btn ant-btn-default ant-btn-color-yellow ant-btn-variant-outlined"
type="button"
>
<button
class="ant-btn ant-btn-default ant-btn-color-default ant-btn-variant-outlined"
type="button"
>
<span>
Warning
</span>
</button>
</div>
<div
class="ant-space-item"
<span>
Warning
</span>
</button>
<button
class="ant-btn ant-btn-default ant-btn-color-red ant-btn-variant-outlined"
type="button"
>
<button
class="ant-btn ant-btn-default ant-btn-color-default ant-btn-variant-outlined"
type="button"
>
<span>
Error
</span>
</button>
</div>
<span>
Error
</span>
</button>
</div>
`;

View File

@@ -12,63 +12,43 @@ exports[`renders components/notification/demo/basic.tsx correctly 1`] = `
`;
exports[`renders components/notification/demo/component-token.tsx correctly 1`] = `
Array [
<h4>
Custom Theme (Enhanced Colors)
</h4>,
<div
class="ant-space ant-space-horizontal ant-space-align-center ant-space-gap-row-small ant-space-gap-col-small"
<div
class="ant-flex ant-flex-wrap-wrap"
style="gap:8px"
>
<button
class="ant-btn ant-btn-default ant-btn-color-green ant-btn-variant-outlined"
type="button"
>
<div
class="ant-space-item"
>
<button
class="ant-btn ant-btn-primary ant-btn-color-primary ant-btn-variant-solid"
type="button"
>
<span>
Custom Success
</span>
</button>
</div>
<div
class="ant-space-item"
>
<button
class="ant-btn ant-btn-default ant-btn-color-default ant-btn-variant-outlined"
type="button"
>
<span>
Custom Info
</span>
</button>
</div>
<div
class="ant-space-item"
>
<button
class="ant-btn ant-btn-default ant-btn-color-default ant-btn-variant-outlined"
type="button"
>
<span>
Custom Warning
</span>
</button>
</div>
<div
class="ant-space-item"
>
<button
class="ant-btn ant-btn-default ant-btn-dangerous ant-btn-color-dangerous ant-btn-variant-outlined"
type="button"
>
<span>
Custom Error
</span>
</button>
</div>
</div>,
]
<span>
Success
</span>
</button>
<button
class="ant-btn ant-btn-default ant-btn-color-blue ant-btn-variant-outlined"
type="button"
>
<span>
Info
</span>
</button>
<button
class="ant-btn ant-btn-default ant-btn-color-yellow ant-btn-variant-outlined"
type="button"
>
<span>
Warning
</span>
</button>
<button
class="ant-btn ant-btn-default ant-btn-color-red ant-btn-variant-outlined"
type="button"
>
<span>
Error
</span>
</button>
</div>
`;
exports[`renders components/notification/demo/custom-icon.tsx correctly 1`] = `
@@ -795,55 +775,40 @@ exports[`renders components/notification/demo/with-btn.tsx correctly 1`] = `
exports[`renders components/notification/demo/with-icon.tsx correctly 1`] = `
<div
class="ant-space ant-space-horizontal ant-space-align-center ant-space-gap-row-small ant-space-gap-col-small"
class="ant-flex ant-flex-wrap-wrap"
style="gap:8px"
>
<div
class="ant-space-item"
<button
class="ant-btn ant-btn-default ant-btn-color-green ant-btn-variant-outlined"
type="button"
>
<button
class="ant-btn ant-btn-default ant-btn-color-default ant-btn-variant-outlined"
type="button"
>
<span>
Success
</span>
</button>
</div>
<div
class="ant-space-item"
<span>
Success
</span>
</button>
<button
class="ant-btn ant-btn-default ant-btn-color-blue ant-btn-variant-outlined"
type="button"
>
<button
class="ant-btn ant-btn-default ant-btn-color-default ant-btn-variant-outlined"
type="button"
>
<span>
Info
</span>
</button>
</div>
<div
class="ant-space-item"
<span>
Info
</span>
</button>
<button
class="ant-btn ant-btn-default ant-btn-color-yellow ant-btn-variant-outlined"
type="button"
>
<button
class="ant-btn ant-btn-default ant-btn-color-default ant-btn-variant-outlined"
type="button"
>
<span>
Warning
</span>
</button>
</div>
<div
class="ant-space-item"
<span>
Warning
</span>
</button>
<button
class="ant-btn ant-btn-default ant-btn-color-red ant-btn-variant-outlined"
type="button"
>
<button
class="ant-btn ant-btn-default ant-btn-color-default ant-btn-variant-outlined"
type="button"
>
<span>
Error
</span>
</button>
</div>
<span>
Error
</span>
</button>
</div>
`;

View File

@@ -1,5 +1,5 @@
import React from 'react';
import { Button, notification, Space, ConfigProvider } from 'antd';
import { Button, notification, Flex, ConfigProvider } from 'antd';
type NotificationType = 'success' | 'info' | 'warning' | 'error';
@@ -16,17 +16,28 @@ const CustomThemeDemo: React.FC = () => {
return (
<>
<h4>Custom Theme (Enhanced Colors)</h4>
<Space>
<Button type="primary" onClick={() => openNotificationWithIcon('success')}>
Custom Success
<Flex gap={8} wrap="wrap">
<Button
color="green"
variant="outlined"
onClick={() => openNotificationWithIcon('success')}
>
Success
</Button>
<Button onClick={() => openNotificationWithIcon('info')}>Custom Info</Button>
<Button onClick={() => openNotificationWithIcon('warning')}>Custom Warning</Button>
<Button danger onClick={() => openNotificationWithIcon('error')}>
Custom Error
<Button color="blue" variant="outlined" onClick={() => openNotificationWithIcon('info')}>
Info
</Button>
</Space>
<Button
color="yellow"
variant="outlined"
onClick={() => openNotificationWithIcon('warning')}
>
Warning
</Button>
<Button color="red" variant="outlined" onClick={() => openNotificationWithIcon('error')}>
Error
</Button>
</Flex>
{contextHolder}
</>
);
@@ -37,10 +48,10 @@ const App: React.FC = () => (
theme={{
components: {
Notification: {
colorSuccessBg: '#d9f7be', // Custom light green for success
colorErrorBg: '#ffccc7', // Custom light red for error
colorInfoBg: '#bae0ff', // Custom light blue for info
colorWarningBg: '#ffffb8', // Custom light yellow for warning
colorSuccessBg: 'linear-gradient(30deg, #d9f7be, #f6ffed)',
colorErrorBg: 'linear-gradient(30deg, #ffccc7, #fff1f0)',
colorInfoBg: 'linear-gradient(30deg, #bae0ff, #e6f4ff)',
colorWarningBg: 'linear-gradient(30deg, #ffffb8, #feffe6)',
},
},
}}

View File

@@ -1,5 +1,5 @@
import React from 'react';
import { Button, notification, Space } from 'antd';
import { Button, notification, Flex } from 'antd';
type NotificationType = 'success' | 'info' | 'warning' | 'error';
@@ -17,12 +17,28 @@ const App: React.FC = () => {
return (
<>
{contextHolder}
<Space>
<Button onClick={() => openNotificationWithIcon('success')}>Success</Button>
<Button onClick={() => openNotificationWithIcon('info')}>Info</Button>
<Button onClick={() => openNotificationWithIcon('warning')}>Warning</Button>
<Button onClick={() => openNotificationWithIcon('error')}>Error</Button>
</Space>
<Flex gap={8} wrap="wrap">
<Button
color="green"
variant="outlined"
onClick={() => openNotificationWithIcon('success')}
>
Success
</Button>
<Button color="blue" variant="outlined" onClick={() => openNotificationWithIcon('info')}>
Info
</Button>
<Button
color="yellow"
variant="outlined"
onClick={() => openNotificationWithIcon('warning')}
>
Warning
</Button>
<Button color="red" variant="outlined" onClick={() => openNotificationWithIcon('error')}>
Error
</Button>
</Flex>
</>
);
};

View File

@@ -377,10 +377,13 @@ const genNotificationStyle: GenerateStyle<NotificationToken> = (token) => {
export const prepareComponentToken = (token: AliasToken) => ({
zIndexPopup: token.zIndexPopupBase + CONTAINER_MAX_OFFSET + 50,
width: 384,
colorSuccessBg: token.colorSuccessBg,
colorErrorBg: token.colorErrorBg,
colorInfoBg: token.colorInfoBg,
colorWarningBg: token.colorWarningBg,
// Fix notification background color issue
// https://github.com/ant-design/ant-design/issues/55649
// https://github.com/ant-design/ant-design/issues/56055
colorSuccessBg: undefined,
colorErrorBg: undefined,
colorInfoBg: undefined,
colorWarningBg: undefined,
});
export const prepareNotificationToken: (

View File

@@ -9402,11 +9402,7 @@ exports[`renders components/space/demo/compact.tsx extend context correctly 1`]
</div>
`;
exports[`renders components/space/demo/compact.tsx extend context correctly 2`] = `
[
"Warning: [antd: Input] \`addonAfter\` is deprecated. Please use \`Space.Compact\` instead.",
]
`;
exports[`renders components/space/demo/compact.tsx extend context correctly 2`] = `[]`;
exports[`renders components/space/demo/compact-button-vertical.tsx extend context correctly 1`] = `
<div
@@ -16427,11 +16423,7 @@ Array [
]
`;
exports[`renders components/space/demo/compact-nested.tsx extend context correctly 2`] = `
[
"Warning: [antd: Input] \`addonAfter\` is deprecated. Please use \`Space.Compact\` instead.",
]
`;
exports[`renders components/space/demo/compact-nested.tsx extend context correctly 2`] = `[]`;
exports[`renders components/space/demo/debug.tsx extend context correctly 1`] = `
<div

View File

@@ -74,4 +74,37 @@ describe('useSizes', () => {
// In impossible case, should average fill (1000 / 3 = 333.33... for each)
expect(postPxSizes).toEqual([1000 / 3, 1000 / 3, 1000 / 3]);
});
it('should average if size total is not 100%', () => {
const items = [
{
size: '20%',
},
{
size: '30%',
},
];
const { result } = renderHook(() => useSizes(items, containerSize));
const [sizes] = result.current;
// Check sizes
expect(sizes).toEqual([400, 600]);
});
it('should correct when all size is 0', () => {
const items = [
{
size: 0,
},
{
size: 0,
},
];
const { result } = renderHook(() => useSizes(items, containerSize));
const [, postPxSizes] = result.current;
expect(postPxSizes).toEqual([500, 500]);
});
});

View File

@@ -19,6 +19,18 @@ export function autoPtgSizes(
const restPtg = 1 - currentTotalPtg;
const undefinedCount = undefinedIndexes.length;
// If all sizes are defined but don't sum to 1, scale them.
if (ptgSizes.length && !undefinedIndexes.length && currentTotalPtg !== 1) {
// Handle the case when all sizes are 0
if (currentTotalPtg === 0) {
const avg = 1 / ptgSizes.length;
return ptgSizes.map(() => avg);
}
const scale = 1 / currentTotalPtg;
// We know `size` is a number here because undefinedIndexes is empty.
return ptgSizes.map((size) => (size as number) * scale);
}
// Fill if exceed
if (restPtg < 0) {
const scale = 1 / currentTotalPtg;

View File

@@ -4718,11 +4718,7 @@ exports[`renders components/tree/demo/search.tsx extend context correctly 1`] =
</div>
`;
exports[`renders components/tree/demo/search.tsx extend context correctly 2`] = `
[
"Warning: [antd: Input] \`addonAfter\` is deprecated. Please use \`Space.Compact\` instead.",
]
`;
exports[`renders components/tree/demo/search.tsx extend context correctly 2`] = `[]`;
exports[`renders components/tree/demo/switcher-icon.tsx extend context correctly 1`] = `
<div

View File

@@ -1,6 +1,6 @@
{
"name": "antd",
"version": "5.29.1",
"version": "5.29.3",
"description": "An enterprise-class UI design language and React components implementation",
"license": "MIT",
"funding": {

View File

@@ -10,6 +10,8 @@ const cwd = process.cwd();
const git = simpleGit(cwd);
const spinner = ora('Loading unicorns').start('开始检查仓库状态');
export const STABLE_BRANCH = '5.x-stable';
function exitProcess(code = 1) {
console.log(''); // Keep an empty line here to make looks good~
process.exit(code);
@@ -52,8 +54,8 @@ async function checkBranch({ current }: StatusResult) {
version.includes('-experimental.')
) {
spinner.info(chalk.cyan('😃 Alpha version. Skip branch check.'));
} else if (current !== 'master') {
spinner.fail(chalk.red('🤔 You are not in the master branch!'));
} else if (current !== STABLE_BRANCH) {
spinner.fail(chalk.red(`🤔 You are not in the ${STABLE_BRANCH} branch!`));
exitProcess();
}
spinner.succeed('分支检查通过');
@@ -73,7 +75,7 @@ async function checkCommit({ files }: StatusResult) {
async function checkRemote() {
spinner.start('正在检查远程分支');
const { remote } = await git.fetch('origin', 'master');
const { remote } = await git.fetch('origin', STABLE_BRANCH);
if (!remote?.includes('ant-design/ant-design')) {
const { value } = await git.getConfig('remote.origin.url');
if (!value?.includes('ant-design/ant-design')) {

View File

@@ -98,7 +98,7 @@ const SAFE_DAYS_DIFF = 1000 * 60 * 60 * 24 * 3; // 3 days not update seems to be
// Not find to use the latest version instead
defaultVersionObj = defaultVersionObj || defaultVersionList[defaultVersionList.length - 1];
let defaultVersion = defaultVersionObj ? defaultVersionObj.value : null;
let defaultVersion = defaultVersionObj ? defaultVersionObj.value : undefined;
// If default version is less than current, use current
if (semver.compare(defaultVersion!, distTags[CONCH_TAG]) < 0) {

View File

@@ -234,7 +234,9 @@ const runPrePublish = async () => {
firstArtifactFile = await Promise.any([downloadArtifactPromise, downloadOSSPromise]);
} catch (error) {
showMessage(
chalk.bgRedBright(`下载失败 ${error},请确认你当前 ${sha.slice(0, 6)} 位于 master 分支中`),
chalk.bgRedBright(
`下载失败 ${error},请确认你当前 ${sha.slice(0, 6)} 位于 5.x-stable 分支中`,
),
'fail',
);
process.exit(1);

View File

@@ -85,15 +85,17 @@ async function printLog() {
let toVersion = await select({
message: `🔀 Please choose branch to compare with ${chalk.magenta(fromVersion)}:`,
choices: ['master', '4.x-stable', '3.x-stable', 'feature', 'custom input ⌨️'].map((i) => ({
name: i,
value: i,
})),
choices: ['master', '5.x-stable', '4.x-stable', '3.x-stable', 'feature', 'custom input ⌨️'].map(
(i) => ({
name: i,
value: i,
}),
),
});
if (toVersion.startsWith('custom input')) {
toVersion = await input({
default: 'master',
default: '5.x-stable',
message: `🔀 Please input custom git hash id or branch name to compare with ${chalk.magenta(
fromVersion,
)}:`,

View File

@@ -65,8 +65,9 @@ async function parseArgs() {
if (!baseRef) {
baseRef = await select({
message: '📚 请选择基准分支',
default: 'master',
default: '5.x-stable',
choices: [
'5.x-stable',
'master',
'feature',
'next',
@@ -77,7 +78,7 @@ async function parseArgs() {
if (baseRef.endsWith('Custom Input')) {
baseRef = await input({
message: '📚 请输入基准分支',
default: 'master',
default: '5.x-stable',
});
}
}