chore: sync feature into next

This commit is contained in:
thinkasany
2025-07-17 11:48:12 +08:00
10 changed files with 65 additions and 13 deletions

View File

@@ -16,7 +16,7 @@ const useLocale = <
): [Record<K, V>, 'cn' | 'en'] => {
const { id } = useDumiLocale();
const localeType = id === 'zh-CN' ? 'cn' : 'en';
return [localeMap?.[localeType]!, localeType] as const;
return [localeMap?.[localeType] ?? ({} as Record<K, V>), localeType] as const;
};
export default useLocale;

View File

@@ -27,7 +27,7 @@ import SiteContext from '../slots/SiteContext';
import '@ant-design/v5-patch-for-react-19';
type Entries<T> = { [K in keyof T]: [K, T[K]] }[keyof T][];
type SiteState = Partial<Omit<SiteContextProps, 'updateSiteContext'>>;
type SiteState = Partial<Omit<SiteContextProps, 'updateSiteConfig'>>;
const RESPONSIVE_MOBILE = 768;
export const ANT_DESIGN_NOT_SHOW_BANNER = 'ANT_DESIGN_NOT_SHOW_BANNER';

View File

@@ -15,6 +15,18 @@ tag: vVERSION
---
## 5.26.5
`2025-07-15`
- 🐞 Fix Tag `closeIcon` not being passed correctly. [#54370](https://github.com/ant-design/ant-design/pull/54370) [@Meet-student](https://github.com/Meet-student)
- 🐞 Fix Splitter mask was not removed after dragging. [#54320](https://github.com/ant-design/ant-design/pull/54320) [@QdabuliuQ](https://github.com/QdabuliuQ)
- 🐞 Fix Modal configuration responsive `width` did not take effect correctly. [#54349](https://github.com/ant-design/ant-design/pull/54349)
- 💄 Optimize the style issue when Notification `description` is empty. [#54344](https://github.com/ant-design/ant-design/pull/54344) [@dengfuping](https://github.com/dengfuping)
- 💄 Fix the border style issue when the FloatButton popup direction is horizontal and is `square`. [#54261](https://github.com/ant-design/ant-design/pull/54261) [@WwwHhhYran](https://github.com/WwwHhhYran)
- TypeScript
- 🤖 Added Dropdown `activeKey` type definition. [#54314](https://github.com/ant-design/ant-design/pull/54314) [@wanpan11](https://github.com/wanpan11)
## 5.26.4
`2025-07-07`

View File

@@ -15,6 +15,18 @@ tag: vVERSION
---
## 5.26.5
`2025-07-15`
- 🐞 修复 Tag `closeIcon` 未正确传递的问题。[#54370](https://github.com/ant-design/ant-design/pull/54370) [@Meet-student](https://github.com/Meet-student)
- 🐞 修复 Splitter 蒙层拖拽后未被移除的问题。[#54320](https://github.com/ant-design/ant-design/pull/54320) [@QdabuliuQ](https://github.com/QdabuliuQ)
- 🐞 修复 Modal 配置响应式 `width` 没有正确生效的问题。[#54349](https://github.com/ant-design/ant-design/pull/54349)
- 💄 优化 Notification `description` 为空时间距样式问题。[#54344](https://github.com/ant-design/ant-design/pull/54344) [@dengfuping](https://github.com/dengfuping)
- 💄 修复 FloatButton 弹出方向为水平方向为 `square` 时的边框样式问题。[#54261](https://github.com/ant-design/ant-design/pull/54261) [@WwwHhhYran](https://github.com/WwwHhhYran)
- TypeScript
- 🤖 补充 Dropdown `activeKey` 类型定义。[#54314](https://github.com/ant-design/ant-design/pull/54314) [@wanpan11](https://github.com/wanpan11)
## 5.26.4
`2025-07-07`

View File

@@ -30,7 +30,7 @@ const AffixMounter: React.FC<AffixProps> = (props) => {
}, []);
return (
<div ref={container} className="container">
<Affix className="fixed" target={() => container.current} {...props}>
<Affix className="placeholder" target={() => container.current} {...props}>
<Button type="primary">Fixed at the top of container</Button>
</Affix>
</div>
@@ -65,7 +65,7 @@ describe('Affix Render', () => {
});
const movePlaceholder = async (top: number) => {
classRect.fixed = { top, bottom: top } as DOMRect;
classRect.placeholder = { top, bottom: top } as DOMRect;
if (events.scroll == null) {
throw new Error('scroll should be set');
}
@@ -184,7 +184,7 @@ describe('Affix Render', () => {
});
// Trigger inner and outer element for the two <ResizeObserver>s.
['.ant-btn', '.fixed'].forEach((selector) => {
['.ant-btn', '.placeholder'].forEach((selector) => {
it(`trigger listener when size change: ${selector}`, async () => {
const updateCalled = jest.fn();
const { container } = render(

View File

@@ -35,9 +35,32 @@ describe('Flex', () => {
expect(container.querySelector('.ant-flex')).toHaveStyle({ justifyContent: 'center' });
rerender(<Flex flex="0 1 auto">test</Flex>);
expect(container.querySelector('.ant-flex')).toHaveStyle({ flex: '0 1 auto' });
rerender(<Flex gap={100}>test</Flex>);
expect(container.querySelector('.ant-flex')).toHaveStyle({ gap: '100px' });
});
describe('Props: gap', () => {
it('support string', () => {
const { container } = render(<Flex id="flex-inherit" gap="inherit" />);
expect(container.querySelector('#flex-inherit')).toHaveStyle({
gap: 'inherit',
});
});
it('support number', () => {
const { container } = render(<Flex gap={100} />);
expect(container.querySelector('.ant-flex')).toHaveStyle({
gap: '100px',
});
});
it('support preset size', () => {
const { container } = render(<Flex gap="small" />);
expect(container.querySelector('.ant-flex')).toHaveClass('ant-flex-gap-small');
});
});
it('Component work', () => {
const testFcRef = React.createRef<HTMLDivElement>();
const testClsRef = React.createRef<ClassCom>();

View File

@@ -18,7 +18,6 @@ const Flex = React.forwardRef<HTMLElement, FlexProps>((props, ref) => {
style,
flex,
gap,
children,
vertical,
orientation,
component: Component = 'div',
@@ -68,9 +67,7 @@ const Flex = React.forwardRef<HTMLElement, FlexProps>((props, ref) => {
className={mergedCls}
style={mergedStyle}
{...omit(othersProps, ['justify', 'wrap', 'align'])}
>
{children}
</Component>
/>
);
});

View File

@@ -14,6 +14,5 @@ export interface FlexProps<P = AnyObject> extends React.HTMLAttributes<HTMLEleme
align?: React.CSSProperties['alignItems'];
flex?: React.CSSProperties['flex'];
gap?: React.CSSProperties['gap'] | SizeType;
children: React.ReactNode;
component?: CustomComponent<P>;
}

View File

@@ -5,7 +5,11 @@ import type {
SubMenuType as RcSubMenuType,
} from '@rc-component/menu/lib/interface';
export interface MenuItemType extends RcMenuItemType {
export type DataAttributes = {
[Key in `data-${string}`]: string | number;
};
export interface MenuItemType extends RcMenuItemType, DataAttributes {
danger?: boolean;
icon?: React.ReactNode;
title?: string;

View File

@@ -49,6 +49,7 @@
"Alexey Teterin",
"Alexey Vinogradov",
"Alexey Yakovlev",
"Alexis Hope",
"Alfred Qiu",
"Ali Zhdanov",
"AliReza Kamkar",
@@ -332,6 +333,7 @@
"Gianmarco Rengucci",
"Gin-X",
"Go7hic",
"Goat",
"Goh Zhao Yang",
"Goku",
"Golevka",
@@ -759,6 +761,7 @@
"OuYancey",
"OweQian",
"Oyster Lee",
"P-a Bäckström",
"PCCCCCCC",
"Pablo Recalde",
"Panjie Setiawan Wicaksono",
@@ -1609,6 +1612,7 @@
"zhipenglin",
"zhiwei liu",
"zhoulixiang",
"zhouxinyong",
"zhuguibiao",
"zhujun24",
"zhuzhu_coder",
@@ -1748,6 +1752,7 @@
"谭真",
"超能刚哥",
"迷渡",
"遇见同学",
"那里好脏不可以",
"郑国庆",
"郑旭",