From f474bf18d8532e3c116f9b1bf0c35cfcfbbc77ad Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 18 Nov 2024 09:55:09 +0800 Subject: [PATCH 01/27] chore: improve Contributors loading suspense style (#51663) --- .dumi/theme/slots/Content/Contributors.tsx | 5 +---- .dumi/theme/slots/Content/index.tsx | 8 +++++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.dumi/theme/slots/Content/Contributors.tsx b/.dumi/theme/slots/Content/Contributors.tsx index 9facb809dc..95747a47dd 100644 --- a/.dumi/theme/slots/Content/Contributors.tsx +++ b/.dumi/theme/slots/Content/Contributors.tsx @@ -8,9 +8,6 @@ import SiteContext from '../SiteContext'; import ContributorAvatar from './ContributorAvatar'; const useStyle = createStyles(({ token, css }) => ({ - contributorsList: css` - margin-top: 120px !important; - `, listMobile: css` margin: 1em 0 !important; `, @@ -50,7 +47,7 @@ const Contributors: React.FC = ({ filename }) => { } return ( -
+
{formatMessage({ id: 'app.content.contributors' })}
= ({ children }) => { juejinLink={meta.frontmatter.juejin_url} /> - }> - - +
+ }> + + +
From f459efef43b43a3de8b9424f463078da4525697d Mon Sep 17 00:00:00 2001 From: Salim Abubakar Date: Mon, 18 Nov 2024 03:18:05 +0100 Subject: [PATCH 02/27] fix: prevent OTP input focus from advancing when previous input is empty (#51664) Co-authored-by: Salim Abubakar --- components/input/OTP/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/input/OTP/index.tsx b/components/input/OTP/index.tsx index b3650641f2..7c10017778 100644 --- a/components/input/OTP/index.tsx +++ b/components/input/OTP/index.tsx @@ -208,7 +208,7 @@ const OTP = React.forwardRef((props, ref) => { const nextCells = patchValue(index, txt); const nextIndex = Math.min(index + txt.length, length - 1); - if (nextIndex !== index) { + if (nextIndex !== index && nextCells[index] !== undefined) { refs.current[nextIndex]?.focus(); } From f6bbacf09fb0dc8c6235d49474b684d63db2a88d Mon Sep 17 00:00:00 2001 From: thinkasany <480968828@qq.com> Date: Mon, 18 Nov 2024 10:26:47 +0800 Subject: [PATCH 03/27] docs: show suffix demo (#51666) --- components/cascader/index.en-US.md | 2 +- components/cascader/index.zh-CN.md | 2 +- components/select/index.en-US.md | 2 +- components/select/index.zh-CN.md | 2 +- components/tree-select/index.en-US.md | 2 +- components/tree-select/index.zh-CN.md | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/components/cascader/index.en-US.md b/components/cascader/index.en-US.md index 9693cdcc08..5c20240c68 100644 --- a/components/cascader/index.en-US.md +++ b/components/cascader/index.en-US.md @@ -31,7 +31,7 @@ demo: Search Load Options Lazily Custom Field Names -Prefix and Suffix +Prefix and Suffix Custom dropdown Placement Status diff --git a/components/cascader/index.zh-CN.md b/components/cascader/index.zh-CN.md index 2f383f8630..ba0c30f644 100644 --- a/components/cascader/index.zh-CN.md +++ b/components/cascader/index.zh-CN.md @@ -32,7 +32,7 @@ demo: 搜索 动态加载选项 自定义字段名 -前后缀 +前后缀 扩展菜单 弹出位置 自定义状态 diff --git a/components/select/index.en-US.md b/components/select/index.en-US.md index c30603f4d7..ea68fb63ff 100644 --- a/components/select/index.en-US.md +++ b/components/select/index.en-US.md @@ -52,7 +52,7 @@ return ( Get value of selected item Automatic tokenization Search and Select Users -Prefix and Suffix +Prefix and Suffix Custom dropdown Hide Already Selected Variants diff --git a/components/select/index.zh-CN.md b/components/select/index.zh-CN.md index d4f66808f6..28abcbb442 100644 --- a/components/select/index.zh-CN.md +++ b/components/select/index.zh-CN.md @@ -53,7 +53,7 @@ return ( 获得选项的文本 自动分词 搜索用户 -前后缀 +前后缀 扩展菜单 隐藏已选择选项 多种形态 diff --git a/components/tree-select/index.en-US.md b/components/tree-select/index.en-US.md index b53df80eb3..f075602663 100644 --- a/components/tree-select/index.en-US.md +++ b/components/tree-select/index.en-US.md @@ -24,7 +24,7 @@ demo: Show Tree Line Placement Status -Prefix and Suffix +Prefix and Suffix _InternalPanelDoNotUseOrYouWillBeFired Component Token diff --git a/components/tree-select/index.zh-CN.md b/components/tree-select/index.zh-CN.md index a94b289df0..3b0098d7a3 100644 --- a/components/tree-select/index.zh-CN.md +++ b/components/tree-select/index.zh-CN.md @@ -25,7 +25,7 @@ demo: 线性样式 弹出位置 自定义状态 -前后缀 +前后缀 \_InternalPanelDoNotUseOrYouWillBeFired 组件 Token From a1bc1118756d130c5573c1c8e07f107bb1bc3144 Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 18 Nov 2024 10:27:12 +0800 Subject: [PATCH 04/27] refactor: tweak button style code (#51646) --- components/button/button.tsx | 5 +- components/button/style/compact.ts | 50 +++++++++++++++++++ components/button/style/compactCmp.ts | 72 --------------------------- 3 files changed, 52 insertions(+), 75 deletions(-) create mode 100644 components/button/style/compact.ts delete mode 100644 components/button/style/compactCmp.ts diff --git a/components/button/button.tsx b/components/button/button.tsx index aa98000d2d..a2241acea2 100644 --- a/components/button/button.tsx +++ b/components/button/button.tsx @@ -22,7 +22,7 @@ import { isTwoCNChar, isUnBorderedButtonVariant, spaceChildren } from './buttonH import IconWrapper from './IconWrapper'; import LoadingIcon from './LoadingIcon'; import useStyle from './style'; -import CompactCmp from './style/compactCmp'; +import Compact from './style/compact'; export type LegacyButtonType = ButtonType | 'danger'; @@ -337,8 +337,7 @@ const InternalCompoundedButton = React.forwardRef< > {iconNode} {kids} - {/* Styles: compact */} - {!!compactItemClassnames && } + {compactItemClassnames && } ); diff --git a/components/button/style/compact.ts b/components/button/style/compact.ts new file mode 100644 index 0000000000..8f17385011 --- /dev/null +++ b/components/button/style/compact.ts @@ -0,0 +1,50 @@ +// Style as inline component +import type { CSSObject } from '@ant-design/cssinjs'; + +import { genCompactItemStyle } from '../../style/compact-item'; +import { genCompactItemVerticalStyle } from '../../style/compact-item-vertical'; +import type { GenerateStyle } from '../../theme/internal'; +import { genSubStyleComponent } from '../../theme/internal'; +import type { ButtonToken } from './token'; +import { prepareComponentToken, prepareToken } from './token'; + +const genButtonCompactStyle: GenerateStyle = (token) => { + const { componentCls, colorPrimaryHover, lineWidth, calc } = token; + const insetOffset = calc(lineWidth).mul(-1).equal(); + const getCompactBorderStyle = (vertical?: boolean) => + ({ + [`${componentCls}-compact${vertical ? '-vertical' : ''}-item${componentCls}-primary:not([disabled])`]: + { + '& + &::before': { + position: 'absolute', + top: vertical ? insetOffset : 0, + insetInlineStart: vertical ? 0 : insetOffset, + backgroundColor: colorPrimaryHover, + content: '""', + width: vertical ? '100%' : lineWidth, + height: vertical ? lineWidth : '100%', + }, + }, + }) as CSSObject; + // Special styles for Primary Button + return { + ...getCompactBorderStyle(), + ...getCompactBorderStyle(true), + }; +}; + +// ============================== Export ============================== +export default genSubStyleComponent( + ['Button', 'compact'], + (token) => { + const buttonToken = prepareToken(token); + + return [ + // Space Compact + genCompactItemStyle(buttonToken), + genCompactItemVerticalStyle(buttonToken), + genButtonCompactStyle(buttonToken), + ]; + }, + prepareComponentToken, +); diff --git a/components/button/style/compactCmp.ts b/components/button/style/compactCmp.ts deleted file mode 100644 index a480dc4a94..0000000000 --- a/components/button/style/compactCmp.ts +++ /dev/null @@ -1,72 +0,0 @@ -// Style as inline component -import { unit } from '@ant-design/cssinjs'; - -import { genCompactItemStyle } from '../../style/compact-item'; -import { genCompactItemVerticalStyle } from '../../style/compact-item-vertical'; -import type { GenerateStyle } from '../../theme/internal'; -import { genSubStyleComponent } from '../../theme/internal'; -import type { ButtonToken } from './token'; -import { prepareComponentToken, prepareToken } from './token'; - -const genButtonCompactStyle: GenerateStyle = (token) => { - const { componentCls, calc } = token; - - return { - [componentCls]: { - // Special styles for Primary Button - [`&-compact-item${componentCls}-primary`]: { - [`&:not([disabled]) + ${componentCls}-compact-item${componentCls}-primary:not([disabled])`]: - { - position: 'relative', - - '&:before': { - position: 'absolute', - top: calc(token.lineWidth).mul(-1).equal(), - insetInlineStart: calc(token.lineWidth).mul(-1).equal(), - display: 'inline-block', - width: token.lineWidth, - height: `calc(100% + ${unit(token.lineWidth)} * 2)`, - backgroundColor: token.colorPrimaryHover, - content: '""', - }, - }, - }, - // Special styles for Primary Button - '&-compact-vertical-item': { - [`&${componentCls}-primary`]: { - [`&:not([disabled]) + ${componentCls}-compact-vertical-item${componentCls}-primary:not([disabled])`]: - { - position: 'relative', - - '&:before': { - position: 'absolute', - top: calc(token.lineWidth).mul(-1).equal(), - insetInlineStart: calc(token.lineWidth).mul(-1).equal(), - display: 'inline-block', - width: `calc(100% + ${unit(token.lineWidth)} * 2)`, - height: token.lineWidth, - backgroundColor: token.colorPrimaryHover, - content: '""', - }, - }, - }, - }, - }, - }; -}; - -// ============================== Export ============================== -export default genSubStyleComponent( - ['Button', 'compact'], - (token) => { - const buttonToken = prepareToken(token); - - return [ - // Space Compact - genCompactItemStyle(buttonToken), - genCompactItemVerticalStyle(buttonToken), - genButtonCompactStyle(buttonToken), - ]; - }, - prepareComponentToken, -); From fb52fbbfd021220ef48629f8ad4ef2d88ad7cb20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9D=91=BE=F0=9D=92=96=F0=9D=92=99=F0=9D=92=89?= Date: Mon, 18 Nov 2024 11:03:58 +0800 Subject: [PATCH 05/27] style: Improve style z-order to fix some errors (#51448) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: IsKaros Co-authored-by: ​ <​> --- components/tree/__tests__/demo-extend.test.ts | 4 +- components/tree/__tests__/demo.test.ts | 4 +- components/tree/demo/directory-debug.md | 7 ++ components/tree/demo/directory-debug.tsx | 65 +++++++++++++++++++ components/tree/index.en-US.md | 1 + components/tree/index.zh-CN.md | 1 + components/tree/style/directory.ts | 5 +- components/tree/style/index.ts | 22 +++---- 8 files changed, 90 insertions(+), 19 deletions(-) create mode 100644 components/tree/demo/directory-debug.md create mode 100644 components/tree/demo/directory-debug.tsx diff --git a/components/tree/__tests__/demo-extend.test.ts b/components/tree/__tests__/demo-extend.test.ts index ad3af91aff..fba75b8bc5 100644 --- a/components/tree/__tests__/demo-extend.test.ts +++ b/components/tree/__tests__/demo-extend.test.ts @@ -1,3 +1,5 @@ import { extendTest } from '../../../tests/shared/demoTest'; -extendTest('tree', { skip: ['big-data.tsx', 'virtual-scroll.tsx', 'component-token.tsx'] }); +extendTest('tree', { + skip: ['big-data.tsx', 'virtual-scroll.tsx', 'component-token.tsx', 'directory-debug.tsx'], +}); diff --git a/components/tree/__tests__/demo.test.ts b/components/tree/__tests__/demo.test.ts index 9d0466c44d..4a85b5f156 100644 --- a/components/tree/__tests__/demo.test.ts +++ b/components/tree/__tests__/demo.test.ts @@ -1,3 +1,5 @@ import demoTest from '../../../tests/shared/demoTest'; -demoTest('tree', { skip: ['big-data.tsx', 'virtual-scroll.tsx', 'component-token.tsx'] }); +demoTest('tree', { + skip: ['big-data.tsx', 'virtual-scroll.tsx', 'component-token.tsx', 'directory-debug.tsx'], +}); diff --git a/components/tree/demo/directory-debug.md b/components/tree/demo/directory-debug.md new file mode 100644 index 0000000000..5fccd6311a --- /dev/null +++ b/components/tree/demo/directory-debug.md @@ -0,0 +1,7 @@ +## zh-CN + +调试 [#51210](https://github.com/ant-design/ant-design/pull/51210), [#51448](https://github.com/ant-design/ant-design/pull/51448#issuecomment-2449144872) + +## en-US + +Debugging [#51210](https://github.com/ant-design/ant-design/pull/51210), [#51448](https://github.com/ant-design/ant-design/pull/51448#issuecomment-2449144872) diff --git a/components/tree/demo/directory-debug.tsx b/components/tree/demo/directory-debug.tsx new file mode 100644 index 0000000000..24182ae9ff --- /dev/null +++ b/components/tree/demo/directory-debug.tsx @@ -0,0 +1,65 @@ +import React from 'react'; +import { Flex, Tree } from 'antd'; +import type { GetProps, TreeDataNode } from 'antd'; + +const { DirectoryTree } = Tree; + +const treeData: TreeDataNode[] = [ + { + title: 'parent 0', + key: '0-0', + children: [ + { title: 'leaf 0-0', key: '0-0-0', isLeaf: true }, + { title: 'leaf 0-1', key: '0-0-1', isLeaf: true }, + ], + }, + { + title: 'parent 1', + key: '0-1', + children: [ + { title: 'leaf 1-0', key: '0-1-0', isLeaf: true }, + { title: 'leaf 1-1', key: '0-1-1', isLeaf: true }, + ], + }, +]; + +const sharedProps: GetProps = { + treeData, + defaultExpandAll: true, + onSelect: (keys, info) => { + console.log('Trigger Select', keys, info); + }, + onExpand: (keys, info) => { + console.log('Trigger Expand', keys, info); + }, +}; + +const DemoOne = () => ; + +const DemoTwo = () => ; + +const DemoThree = () => ( + +); + +const BasicDemo = () => ; + +const NormalDemo = () => ; + +const NormalCheckDemo = () => ; + +const NormalDragDemo = () => ; + +const App = () => ( + + + + + + + + + +); + +export default App; diff --git a/components/tree/index.en-US.md b/components/tree/index.en-US.md index f677738e6d..f3a40d0543 100644 --- a/components/tree/index.en-US.md +++ b/components/tree/index.en-US.md @@ -24,6 +24,7 @@ Almost anything can be represented in a tree structure. Examples include directo Tree with line Customize Icon directory +Directory Debug Customize collapse/expand icon Virtual scroll Drag Debug diff --git a/components/tree/index.zh-CN.md b/components/tree/index.zh-CN.md index 35d90e40e5..df9cdb2b86 100644 --- a/components/tree/index.zh-CN.md +++ b/components/tree/index.zh-CN.md @@ -25,6 +25,7 @@ demo: 连接线 自定义图标 目录 +目录 Debug 自定义展开/折叠图标 虚拟滚动 Drag Debug diff --git a/components/tree/style/directory.ts b/components/tree/style/directory.ts index fd099f6861..a8ee02b592 100644 --- a/components/tree/style/directory.ts +++ b/components/tree/style/directory.ts @@ -38,15 +38,14 @@ export const genDirectoryStyle = ({ }, }, - [`${treeCls}-switcher`]: { - marginInlineEnd: 0, + [`${treeCls}-switcher, ${treeCls}-checkbox, ${treeCls}-draggable-icon`]: { + zIndex: 1, }, // ============= Selected ============= '&-selected': { [`${treeCls}-switcher, ${treeCls}-draggable-icon`]: { color: directoryNodeSelectedColor, - zIndex: 1, }, // >>> Title diff --git a/components/tree/style/index.ts b/components/tree/style/index.ts index 9f0b350b8e..eac80ab307 100644 --- a/components/tree/style/index.ts +++ b/components/tree/style/index.ts @@ -120,7 +120,6 @@ export const genBaseStyle = (prefixCls: string, token: TreeToken): CSSObject => nodeHoverBg, colorTextQuaternary, } = token; - const treeCheckBoxMarginHorizontal = token.marginXXS; return { [treeCls]: { @@ -253,6 +252,14 @@ export const genBaseStyle = (prefixCls: string, token: TreeToken): CSSObject => visibility: 'hidden', }, + // Switcher / Checkbox + [`${treeCls}-switcher, ${treeCls}-checkbox`]: { + marginInlineEnd: token + .calc(token.calc(titleHeight).sub(token.controlInteractiveSize)) + .div(2) + .equal(), + }, + // >>> Switcher [`${treeCls}-switcher`]: { ...getSwitchStyle(prefixCls, token), @@ -260,15 +267,10 @@ export const genBaseStyle = (prefixCls: string, token: TreeToken): CSSObject => flex: 'none', alignSelf: 'stretch', width: titleHeight, - margin: 0, textAlign: 'center', cursor: 'pointer', userSelect: 'none', transition: `all ${token.motionDurationSlow}`, - marginInlineEnd: token - .calc(token.calc(titleHeight).sub(token.controlInteractiveSize)) - .div(2) - .equal(), '&-noop': { cursor: 'unset', @@ -329,14 +331,6 @@ export const genBaseStyle = (prefixCls: string, token: TreeToken): CSSObject => }, }, - // >>> Checkbox - [`${treeCls}-checkbox`]: { - top: 'initial', - marginInlineEnd: treeCheckBoxMarginHorizontal, - alignSelf: 'flex-start', - marginTop: token.marginXXS, - }, - // >>> Title // add `${treeCls}-checkbox + span` to cover checkbox `${checkboxCls} + span` [`${treeCls}-node-content-wrapper`]: { From 4b186714d0491af7c6c9bc53ec046d65cca2f549 Mon Sep 17 00:00:00 2001 From: zyf <81416635+Zyf665@users.noreply.github.com> Date: Mon, 18 Nov 2024 11:31:38 +0800 Subject: [PATCH 06/27] fix(Table): preserve custom event handlers in row selection (#51661) --- .../__tests__/Table.rowSelection.test.tsx | 72 +++++++++++++++++++ components/table/hooks/useSelection.tsx | 19 +++-- 2 files changed, 86 insertions(+), 5 deletions(-) diff --git a/components/table/__tests__/Table.rowSelection.test.tsx b/components/table/__tests__/Table.rowSelection.test.tsx index 4f86b15b10..4ba6f2c8b3 100644 --- a/components/table/__tests__/Table.rowSelection.test.tsx +++ b/components/table/__tests__/Table.rowSelection.test.tsx @@ -1905,4 +1905,76 @@ describe('Table.rowSelection', () => { ); }); }); + + it('should trigger both custom and internal checkbox events', () => { + const onClickMock = jest.fn(); + const onChangeMock = jest.fn(); + + const getCheckboxProps = () => ({ + onClick: onClickMock, + onChange: onChangeMock, + }); + + const { container } = render( + , + ); + + const firstRowCheckbox = container.querySelector('tbody tr:first-child input[type="checkbox"]'); + expect(firstRowCheckbox).toBeTruthy(); + + fireEvent.click(firstRowCheckbox!); + + expect(onClickMock).toHaveBeenCalled(); + expect(onClickMock.mock.calls.length).toBe(1); + + expect(onChangeMock).toHaveBeenCalled(); + expect(onChangeMock.mock.calls.length).toBe(1); + + const changeEvent = onChangeMock.mock.calls[0][0]; + expect(changeEvent).toHaveProperty('target'); + expect(changeEvent.target).toHaveProperty('checked'); + }); + + it('should trigger both custom and internal radio events', () => { + const onClickMock = jest.fn(); + const onChangeMock = jest.fn(); + + const getCheckboxProps = () => ({ + onClick: onClickMock, + onChange: onChangeMock, + }); + + const { container } = render( +
, + ); + + const firstRowRadio = container.querySelector('tbody tr:first-child input[type="radio"]'); + expect(firstRowRadio).toBeTruthy(); + + fireEvent.click(firstRowRadio!); + + expect(onClickMock).toHaveBeenCalled(); + expect(onClickMock.mock.calls.length).toBe(1); + + expect(onChangeMock).toHaveBeenCalled(); + expect(onChangeMock.mock.calls.length).toBe(1); + + const changeEvent = onChangeMock.mock.calls[0][0]; + expect(changeEvent).toHaveProperty('target'); + expect(changeEvent.target).toHaveProperty('checked'); + }); }); diff --git a/components/table/hooks/useSelection.tsx b/components/table/hooks/useSelection.tsx index 8cf525fe47..0d7f77285c 100644 --- a/components/table/hooks/useSelection.tsx +++ b/components/table/hooks/useSelection.tsx @@ -496,17 +496,21 @@ const useSelection = ( renderCell = (_, record, index) => { const key = getRowKey(record, index); const checked = keySet.has(key); - + const checkboxProps = checkboxPropsMap.get(key); return { node: ( e.stopPropagation()} + onClick={(e) => { + e.stopPropagation(); + checkboxProps?.onClick?.(e); + }} onChange={(event) => { if (!keySet.has(key)) { triggerSingleSelection(key, true, [key], event.nativeEvent); } + checkboxProps?.onChange?.(event); }} /> ), @@ -538,8 +542,12 @@ const useSelection = ( indeterminate={mergedIndeterminate} checked={checked} skipGroup - onClick={(e) => e.stopPropagation()} - onChange={({ nativeEvent }) => { + onClick={(e) => { + e.stopPropagation(); + checkboxProps?.onClick?.(e); + }} + onChange={(event) => { + const { nativeEvent } = event; const { shiftKey } = nativeEvent; const currentSelectedIndex = recordKeys.findIndex((item) => item === key); const isMultiple = derivedSelectedKeys.some((item) => recordKeys.includes(item)); @@ -595,6 +603,7 @@ const useSelection = ( } else { updatePrevSelectedIndex(currentSelectedIndex); } + checkboxProps?.onChange?.(event); }} /> ), From f7aa3ec6929ff4e661834a4142bcb01658483466 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9D=91=BE=F0=9D=92=96=F0=9D=92=99=F0=9D=92=89?= Date: Mon, 18 Nov 2024 11:44:26 +0800 Subject: [PATCH 07/27] chore: Update scripts/visual-regression/report-template.html (#51672) --- scripts/visual-regression/report-template.html | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scripts/visual-regression/report-template.html b/scripts/visual-regression/report-template.html index 1bc3e6354e..674b60f1b4 100644 --- a/scripts/visual-regression/report-template.html +++ b/scripts/visual-regression/report-template.html @@ -29,6 +29,11 @@ border-collapse: collapse; } + table > thead { + position: sticky; + top: 0; + } + th, td { padding: 8px; @@ -61,13 +66,22 @@ border: 0; } + table > thead { + position: unset; + } + th, td { + width: 100%; display: block; padding: 6px; border: none; } + td:last-child { + border-bottom: 3px dashed darkgray; + } + th { text-align: left; background-color: transparent; From e34a6a8c6f6ecfe51e2cb5bf0a3231b541fbb850 Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 18 Nov 2024 12:03:52 +0800 Subject: [PATCH 08/27] fix: Button custom icon is not align center (#51652) --- components/button/style/index.ts | 8 ++------ components/upload/style/list.ts | 10 ++-------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/components/button/style/index.ts b/components/button/style/index.ts index 7613a72488..9b44062b9b 100644 --- a/components/button/style/index.ts +++ b/components/button/style/index.ts @@ -38,12 +38,8 @@ const genSharedButtonStyle: GenerateStyle = (token): CSS pointerEvents: 'none', }, - '> span': { - display: 'inline-block', - }, - - [`${componentCls}-icon`]: { - lineHeight: 1, + [`> span, ${componentCls}-icon`]: { + display: 'inline-flex', }, '> a': { diff --git a/components/upload/style/list.ts b/components/upload/style/list.ts index 03b9b47775..00d6622eb0 100644 --- a/components/upload/style/list.ts +++ b/components/upload/style/list.ts @@ -5,11 +5,10 @@ import { clearFix, textEllipsis } from '../../style'; import type { GenerateStyle } from '../../theme/internal'; const genListStyle: GenerateStyle = (token) => { - const { componentCls, antCls, iconCls, fontSize, lineHeight, calc } = token; + const { componentCls, iconCls, fontSize, lineHeight, calc } = token; const itemCls = `${componentCls}-list-item`; const actionsCls = `${itemCls}-actions`; const actionCls = `${itemCls}-action`; - const listItemHeightSM = token.fontHeightSM; return { [`${componentCls}-wrapper`]: { @@ -25,6 +24,7 @@ const genListStyle: GenerateStyle = (token) => { display: 'flex', alignItems: 'center', transition: `background-color ${token.motionDurationSlow}`, + borderRadius: token.borderRadiusSM, '&:hover': { backgroundColor: token.controlItemBgHover, @@ -56,12 +56,6 @@ const genListStyle: GenerateStyle = (token) => { `]: { opacity: 1, }, - - [`${actionCls}${antCls}-btn`]: { - height: listItemHeightSM, - border: 0, - lineHeight: 1, - }, }, [`${componentCls}-icon ${iconCls}`]: { From 3cdcf7834d4b6e8452a2750c65db77c46ac4f6ef Mon Sep 17 00:00:00 2001 From: MadCcc Date: Mon, 18 Nov 2024 19:54:19 +0800 Subject: [PATCH 09/27] docs: changelog 5.22.2 (#51670) * docs: changelog 5.22.2 * Apply suggestions from code review Co-authored-by: afc163 Signed-off-by: MadCcc <1075746765@qq.com> * Update CHANGELOG.en-US.md Co-authored-by: thinkasany <480968828@qq.com> Signed-off-by: MadCcc <1075746765@qq.com> * docs: update --------- Signed-off-by: MadCcc <1075746765@qq.com> Co-authored-by: afc163 Co-authored-by: thinkasany <480968828@qq.com> --- CHANGELOG.en-US.md | 12 ++++++++++++ CHANGELOG.zh-CN.md | 12 ++++++++++++ package.json | 2 +- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index 4a5e794f74..289a12cc53 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -15,6 +15,18 @@ tag: vVERSION --- +## 5.22.2 + +`2024-11-18` + +- 🐞 Fix Input.OTP focus from advancing when previous input is empty. [#51664](https://github.com/ant-design/ant-design/pull/51664) [@thecodesalim](https://github.com/thecodesalim) +- 🐞 Adjust Modal function call not to scroll the confirm button when it get auto focused. [#51647](https://github.com/ant-design/ant-design/pull/51647) [@zombieJ](https://github.com/zombieJ) +- 🐞 Fix Form `rules` with same error content will cause React render warning. [#51636](https://github.com/ant-design/ant-design/pull/51636) [@zombieJ](https://github.com/zombieJ) +- 🐞 Refactor Button `focus` logic trigger with `useEffect` to resolve some async load case not get `autoFocus`. [#51624](https://github.com/ant-design/ant-design/pull/51624) [@zombieJ](https://github.com/zombieJ) +- 🐞 Fix Button custom icon not center-aligned. [#51652](https://github.com/ant-design/ant-design/pull/51652) [@afc163](https://github.com/afc163) +- 🐞 Fix Table `getCheckboxProps` event handlers being overridden by internal selection logic. [#51661](https://github.com/ant-design/ant-design/pull/51661) [@Zyf665](https://github.com/Zyf665) +- 🇷🇺 Added support for Russian translation. [#51619](https://github.com/ant-design/ant-design/pull/51619) [@avvakumovid](https://github.com/avvakumovid) + ## 5.22.1 `2024-11-13` diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index 96c8a69692..faa8b9e70a 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -15,6 +15,18 @@ tag: vVERSION --- +## 5.22.2 + +`2024-11-18` + +- 🐞 修复 Input.OTP 组件在有非法输入时仍会切换到下一个输入框的问题。[#51664](https://github.com/ant-design/ant-design/pull/51664) [@thecodesalim](https://github.com/thecodesalim) +- 🐞 调整 Modal 确认函数,使其在弹出后聚焦确认按钮时不要滚动窗体。[#51647](https://github.com/ant-design/ant-design/pull/51647) [@zombieJ](https://github.com/zombieJ) +- 🐞 修复 Form `rules` 生成多条相同错误时会报 React 渲染错误的问题。[#51636](https://github.com/ant-design/ant-design/pull/51636) [@zombieJ](https://github.com/zombieJ) +- 🐞 调整 Button 使用 `useEffect` 来触发 `autoFocus` 逻辑,以解决一些异步渲染场景下 Button 无法自动聚焦的问题。[#51624](https://github.com/ant-design/ant-design/pull/51624) [@zombieJ](https://github.com/zombieJ) +- 🐞 修复 Button 中使用自定义三方图标库时图标未居中的问题。[#51652](https://github.com/ant-design/ant-design/pull/51652) [@afc163](https://github.com/afc163) +- 🐞 修复 Table 组件 `getCheckboxProps` 中的事件处理器被内部选择逻辑覆盖的问题。[#51661](https://github.com/ant-design/ant-design/pull/51661) [@Zyf665](https://github.com/Zyf665) +- 🇷🇺 添加了俄语翻译支持。[#51619](https://github.com/ant-design/ant-design/pull/51619) [@avvakumovid](https://github.com/avvakumovid) + ## 5.22.1 `2024-11-13` diff --git a/package.json b/package.json index d60c474f78..d979a56eca 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "antd", - "version": "5.22.1", + "version": "5.22.2", "description": "An enterprise-class UI design language and React components implementation", "license": "MIT", "funding": { From 2f401935f3ae8fb75d8f41b88864e0b644fa05b7 Mon Sep 17 00:00:00 2001 From: zhangchao <13170027668@163.com> Date: Mon, 18 Nov 2024 22:32:33 +0800 Subject: [PATCH 10/27] docs: Cascader notFoundContent should be ReactNode (#51684) --- components/cascader/index.en-US.md | 2 +- components/cascader/index.zh-CN.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/cascader/index.en-US.md b/components/cascader/index.en-US.md index 5c20240c68..70b4656f1f 100644 --- a/components/cascader/index.en-US.md +++ b/components/cascader/index.en-US.md @@ -67,7 +67,7 @@ Common props ref:[Common props](/docs/react/common-props) | maxTagCount | Max tag count to show. `responsive` will cost render performance | number \| `responsive` | - | 4.17.0 | | maxTagPlaceholder | Placeholder for not showing tags | ReactNode \| function(omittedValues) | - | 4.17.0 | | maxTagTextLength | Max tag text length to show | number | - | 4.17.0 | -| notFoundContent | Specify content to show when no result matches | string | `Not Found` | | +| notFoundContent | Specify content to show when no result matches | ReactNode | `Not Found` | | | open | Set visible of cascader popup | boolean | - | 4.17.0 | | options | The data options of cascade | [Option](#option)\[] | - | | | placeholder | The input placeholder | string | - | | diff --git a/components/cascader/index.zh-CN.md b/components/cascader/index.zh-CN.md index ba0c30f644..cedd36f33b 100644 --- a/components/cascader/index.zh-CN.md +++ b/components/cascader/index.zh-CN.md @@ -68,7 +68,7 @@ demo: | maxTagCount | 最多显示多少个 tag,响应式模式会对性能产生损耗 | number \| `responsive` | - | 4.17.0 | | maxTagPlaceholder | 隐藏 tag 时显示的内容 | ReactNode \| function(omittedValues) | - | 4.17.0 | | maxTagTextLength | 最大显示的 tag 文本长度 | number | - | 4.17.0 | -| notFoundContent | 当下拉列表为空时显示的内容 | string | `Not Found` | | +| notFoundContent | 当下拉列表为空时显示的内容 | ReactNode | `Not Found` | | | open | 控制浮层显隐 | boolean | - | 4.17.0 | | options | 可选项数据源 | [Option](#option)\[] | - | | | placeholder | 输入框占位文本 | string | - | | From 8d7e8ae679b5f327b10a6917cd70a2546cf11deb Mon Sep 17 00:00:00 2001 From: Lorenzo Cardinali Date: Tue, 19 Nov 2024 02:31:34 +0100 Subject: [PATCH 11/27] fix: add missed translation in it_IT (#51685) --- components/time-picker/locale/it_IT.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/components/time-picker/locale/it_IT.ts b/components/time-picker/locale/it_IT.ts index 6aa9d80341..0ecef5974e 100644 --- a/components/time-picker/locale/it_IT.ts +++ b/components/time-picker/locale/it_IT.ts @@ -2,6 +2,7 @@ import type { TimePickerLocale } from '../index'; const locale: TimePickerLocale = { placeholder: "Selezionare l'orario", + rangePlaceholder: ['Inizio orario', 'Fine orario'], }; export default locale; From f1ff05d519acb05e0447aa0a4e3650cbc2100800 Mon Sep 17 00:00:00 2001 From: MadCcc Date: Tue, 19 Nov 2024 10:40:47 +0800 Subject: [PATCH 12/27] chore: update changelog date (#51686) --- CHANGELOG.en-US.md | 2 +- CHANGELOG.zh-CN.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index 289a12cc53..040b8986d5 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -17,7 +17,7 @@ tag: vVERSION ## 5.22.2 -`2024-11-18` +`2024-11-19` - 🐞 Fix Input.OTP focus from advancing when previous input is empty. [#51664](https://github.com/ant-design/ant-design/pull/51664) [@thecodesalim](https://github.com/thecodesalim) - 🐞 Adjust Modal function call not to scroll the confirm button when it get auto focused. [#51647](https://github.com/ant-design/ant-design/pull/51647) [@zombieJ](https://github.com/zombieJ) diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index faa8b9e70a..b5e0d826d8 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -17,7 +17,7 @@ tag: vVERSION ## 5.22.2 -`2024-11-18` +`2024-11-19` - 🐞 修复 Input.OTP 组件在有非法输入时仍会切换到下一个输入框的问题。[#51664](https://github.com/ant-design/ant-design/pull/51664) [@thecodesalim](https://github.com/thecodesalim) - 🐞 调整 Modal 确认函数,使其在弹出后聚焦确认按钮时不要滚动窗体。[#51647](https://github.com/ant-design/ant-design/pull/51647) [@zombieJ](https://github.com/zombieJ) From 64cba3d3168fcdd971ac25fee11baf068053dc62 Mon Sep 17 00:00:00 2001 From: DDDDD12138 <43703884+DDDDD12138@users.noreply.github.com> Date: Tue, 19 Nov 2024 10:41:21 +0800 Subject: [PATCH 13/27] docs(list): remove unexpected message on initial data load (#51687) --- components/list/demo/virtual-list.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/list/demo/virtual-list.tsx b/components/list/demo/virtual-list.tsx index d81465c024..a4fd604d1f 100644 --- a/components/list/demo/virtual-list.tsx +++ b/components/list/demo/virtual-list.tsx @@ -25,17 +25,17 @@ const ContainerHeight = 400; const App: React.FC = () => { const [data, setData] = useState([]); - const appendData = () => { + const appendData = (showMessage = true) => { fetch(fakeDataUrl) .then((res) => res.json()) .then((body) => { setData(data.concat(body.results)); - message.success(`${body.results.length} more items loaded!`); + showMessage && message.success(`${body.results.length} more items loaded!`); }); }; useEffect(() => { - appendData(); + appendData(false); }, []); const onScroll = (e: React.UIEvent) => { From 0d5f4ff95c6980499b09a42e704ae095d7a465d6 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 19 Nov 2024 17:31:13 +0800 Subject: [PATCH 14/27] chore: remove useless var (#51689) --- components/button/style/index.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/components/button/style/index.ts b/components/button/style/index.ts index 9b44062b9b..7a3346d09c 100644 --- a/components/button/style/index.ts +++ b/components/button/style/index.ts @@ -525,10 +525,11 @@ const genButtonStyle = (token: ButtonToken, prefixCls = ''): CSSInterpolation => buttonPaddingHorizontal, iconCls, buttonPaddingVertical, + motionDurationSlow, + motionEaseInOut, + buttonIconOnlyFontSize, + opacityLoading, } = token; - - const iconOnlyCls = `${componentCls}-icon-only`; - return [ { [prefixCls]: { @@ -538,7 +539,7 @@ const genButtonStyle = (token: ButtonToken, prefixCls = ''): CSSInterpolation => padding: `${unit(buttonPaddingVertical!)} ${unit(buttonPaddingHorizontal!)}`, borderRadius, - [`&${iconOnlyCls}`]: { + [`&${componentCls}-icon-only`]: { width: controlHeight, paddingInline: 0, @@ -552,22 +553,21 @@ const genButtonStyle = (token: ButtonToken, prefixCls = ''): CSSInterpolation => }, [iconCls]: { - fontSize: token.buttonIconOnlyFontSize, + fontSize: buttonIconOnlyFontSize, }, }, // Loading [`&${componentCls}-loading`]: { - opacity: token.opacityLoading, + opacity: opacityLoading, cursor: 'default', }, [`${componentCls}-loading-icon`]: { - transition: `width ${token.motionDurationSlow} ${token.motionEaseInOut}, opacity ${token.motionDurationSlow} ${token.motionEaseInOut}`, + transition: `width ${motionDurationSlow} ${motionEaseInOut}, opacity ${motionDurationSlow} ${motionEaseInOut}`, }, }, }, - // Shape - patch prefixCls again to override solid border radius style { [`${componentCls}${componentCls}-circle${prefixCls}`]: genCircleButtonStyle(token), From 7dfc5e3337561e9b033de7e3d51e00aa2892e7df Mon Sep 17 00:00:00 2001 From: thinkasany <480968828@qq.com> Date: Tue, 19 Nov 2024 18:42:39 +0800 Subject: [PATCH 15/27] type(TextArea): combine TextAreaRef and TextAreaProps imports (#51695) --- components/input/TextArea.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/components/input/TextArea.tsx b/components/input/TextArea.tsx index 3851515082..ef49363f39 100644 --- a/components/input/TextArea.tsx +++ b/components/input/TextArea.tsx @@ -1,10 +1,8 @@ import * as React from 'react'; import { forwardRef } from 'react'; import classNames from 'classnames'; -import type { TextAreaRef as RcTextAreaRef } from 'rc-textarea'; +import type { TextAreaRef as RcTextAreaRef, TextAreaProps as RcTextAreaProps } from 'rc-textarea'; import RcTextArea from 'rc-textarea'; -import type { TextAreaProps as RcTextAreaProps } from 'rc-textarea/lib/interface'; - import getAllowClear from '../_util/getAllowClear'; import type { InputStatus } from '../_util/statusUtils'; import { getMergedStatus, getStatusClassNames } from '../_util/statusUtils'; From 556e8e821c0d1867bb7cbbf78ec9864a64d3b7e0 Mon Sep 17 00:00:00 2001 From: MadCcc Date: Tue, 19 Nov 2024 22:35:35 +0800 Subject: [PATCH 16/27] docs: update changelog 5.22.2 (#51688) * chore: update changelog date * docs: update changelog * docs: update bugver * Update CHANGELOG.en-US.md Co-authored-by: thinkasany <480968828@qq.com> Signed-off-by: MadCcc <1075746765@qq.com> --------- Signed-off-by: MadCcc <1075746765@qq.com> Co-authored-by: thinkasany <480968828@qq.com> --- BUG_VERSIONS.json | 14 +++++++++++++- CHANGELOG.en-US.md | 5 ++++- CHANGELOG.zh-CN.md | 5 ++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/BUG_VERSIONS.json b/BUG_VERSIONS.json index f04929ca7b..c39e264791 100644 --- a/BUG_VERSIONS.json +++ b/BUG_VERSIONS.json @@ -62,5 +62,17 @@ "https://github.com/ant-design/ant-design/issues/50960", "https://github.com/ant-design/ant-design/issues/50969" ], - "5.22.0": ["https://github.com/ant-design/ant-design/issues/51601"] + "5.21.6": [ + "https://github.com/ant-design/ant-design/issues/51420", + "https://github.com/ant-design/ant-design/issues/51430" + ], + "5.22.0": [ + "https://github.com/ant-design/ant-design/issues/51601", + "https://github.com/ant-design/ant-design/issues/51420", + "https://github.com/ant-design/ant-design/issues/51430" + ], + "5.22.1": [ + "https://github.com/ant-design/ant-design/issues/51420", + "https://github.com/ant-design/ant-design/issues/51430" + ] } diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index 040b8986d5..4f0a5a874c 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -25,7 +25,10 @@ tag: vVERSION - 🐞 Refactor Button `focus` logic trigger with `useEffect` to resolve some async load case not get `autoFocus`. [#51624](https://github.com/ant-design/ant-design/pull/51624) [@zombieJ](https://github.com/zombieJ) - 🐞 Fix Button custom icon not center-aligned. [#51652](https://github.com/ant-design/ant-design/pull/51652) [@afc163](https://github.com/afc163) - 🐞 Fix Table `getCheckboxProps` event handlers being overridden by internal selection logic. [#51661](https://github.com/ant-design/ant-design/pull/51661) [@Zyf665](https://github.com/Zyf665) -- 🇷🇺 Added support for Russian translation. [#51619](https://github.com/ant-design/ant-design/pull/51619) [@avvakumovid](https://github.com/avvakumovid) +- 🐞 Fix Tree that `onCheck` and `onSelect` were not properly triggered. [#51448](https://github.com/ant-design/ant-design/pull/51448) [@Wxh16144](https://github.com/Wxh16144) +- 🌐 Localization + - 🇷🇺 Add support for Russian translation. [#51619](https://github.com/ant-design/ant-design/pull/51619) [@avvakumovid](https://github.com/avvakumovid) + - 🇮🇹 Add support for Italian translation in TimePicker. [#51685](https://github.com/ant-design/ant-design/pull/51685) [@LorenzoCardinali](https://github.com/LorenzoCardinali) ## 5.22.1 diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index b5e0d826d8..ec6067b57d 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -25,7 +25,10 @@ tag: vVERSION - 🐞 调整 Button 使用 `useEffect` 来触发 `autoFocus` 逻辑,以解决一些异步渲染场景下 Button 无法自动聚焦的问题。[#51624](https://github.com/ant-design/ant-design/pull/51624) [@zombieJ](https://github.com/zombieJ) - 🐞 修复 Button 中使用自定义三方图标库时图标未居中的问题。[#51652](https://github.com/ant-design/ant-design/pull/51652) [@afc163](https://github.com/afc163) - 🐞 修复 Table 组件 `getCheckboxProps` 中的事件处理器被内部选择逻辑覆盖的问题。[#51661](https://github.com/ant-design/ant-design/pull/51661) [@Zyf665](https://github.com/Zyf665) -- 🇷🇺 添加了俄语翻译支持。[#51619](https://github.com/ant-design/ant-design/pull/51619) [@avvakumovid](https://github.com/avvakumovid) +- 🐞 修复 Tree 组件的 `onCheck` 和 `onSelect` 事件没有被正确触发的问题。[#51448](https://github.com/ant-design/ant-design/pull/51448) [@Wxh16144](https://github.com/Wxh16144) +- 🌐 本地化 + - 🇷🇺 添加了俄语翻译支持。[#51619](https://github.com/ant-design/ant-design/pull/51619) [@avvakumovid](https://github.com/avvakumovid) + - 🇮🇹 为 TimePicker 添加了意大利语翻译。[#51685](https://github.com/ant-design/ant-design/pull/51685) [@LorenzoCardinali](https://github.com/LorenzoCardinali) ## 5.22.1 From 579d1723a8e2db0baba0652bc6682389f3cd39b6 Mon Sep 17 00:00:00 2001 From: jynxio Date: Wed, 20 Nov 2024 09:52:08 +0800 Subject: [PATCH 17/27] fix: Vertical alignment of clear icon in Input (#51700) --- components/input/style/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/components/input/style/index.ts b/components/input/style/index.ts index a1585c51a8..5a6449f2d0 100644 --- a/components/input/style/index.ts +++ b/components/input/style/index.ts @@ -421,6 +421,7 @@ const genAllowClearStyle = (token: InputToken): CSSObject => { // ========================= Input ========================= [`${componentCls}-clear-icon`]: { margin: 0, + lineHeight: 0, color: token.colorTextQuaternary, fontSize: token.fontSizeIcon, verticalAlign: -1, From af7bce752ab74464f72aae1020e8910f5260fc85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E7=88=B1=E5=90=83=E7=99=BD=E8=90=9D?= =?UTF-8?q?=E5=8D=9C?= Date: Wed, 20 Nov 2024 11:54:49 +0800 Subject: [PATCH 18/27] fix: Select align issue (#51694) * fix: item align logic * fix: placeholder style * test: update snapshot * fix: single align * chore: add demo * test: update snapshot * fix: color * fix: style * fix: line height * fix: borderless pos * chore: base of prefix offset --- .../__snapshots__/demo-extend.test.ts.snap | 3842 ++++++++++++++--- .../__snapshots__/demo.test.tsx.snap | 1846 +++++++- .../select/demo/option-label-center.tsx | 229 +- components/select/style/index.ts | 20 + components/select/style/multiple.ts | 45 +- components/select/style/single.ts | 16 +- components/select/style/variants.ts | 14 +- 7 files changed, 5083 insertions(+), 929 deletions(-) diff --git a/components/select/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/select/__tests__/__snapshots__/demo-extend.test.ts.snap index 4449454b6c..39fdbb33ec 100644 --- a/components/select/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/select/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -7335,218 +7335,2871 @@ exports[`renders components/select/demo/optgroup.tsx extend context correctly 1` exports[`renders components/select/demo/optgroup.tsx extend context correctly 2`] = `[]`; exports[`renders components/select/demo/option-label-center.tsx extend context correctly 1`] = ` -
+Array [
- - - - - long, long, long piece of text - - -
-
-
-
- +
+
+
+
+ long +
+
+ short +
- short -
-
-
-
-
-
+
+
-
- long, long, long piece of text -
-
-
-
-
-
- short -
-
-
-
-
-
- normal +
+ long, long, long piece of text +
+
+
+
+
+ short +
+
+
+
+
+
+ normal +
+
+
-
+ +
- -
-
-
+
+
+ + + + + + Select a option + + +
+
+
+
+
+ long +
+
+ short +
+
+
+
+
+
+
+
+
+ long, long, long piece of text +
+
+
+
+
+
+ short +
+
+
+
+
+
+ normal +
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+ + + + + +
+ normal +
+
+
+
+
+
+
+
+ long +
+
+ short +
+
+
+
+
+
+
+
+
+ long, long, long piece of text +
+
+
+
+
+
+ short +
+
+
+
+
+
+ normal +
+
+
+
+
+
+
+
+
+ + +
+
+
+ +
+
+ +
+
+
+
+ + + + + + Select a option + + +
+
+
+
+ +
+
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+
+ + + + + + Bamboo + + +
+
+
+
+
+ long +
+
+ short +
+
+
+
+
+
+
+
+
+ long, long, long piece of text +
+
+
+
+
+
+ short +
+
+
+
+
+
+ normal +
+
+
+
+
+
+
+
+
+ + +
+
+
+
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+ +
+
, +
+ + + Hi + + + + + + + + + + + -
-
+
+ Hi +
@@ -7732,20 +10382,16 @@ exports[`renders components/select/demo/option-label-center.tsx extend context c autocomplete="off" class="ant-select-selection-search-input" id="rc_select_TEST_OR_SSR" - readonly="" role="combobox" - style="opacity: 0;" type="search" - unselectable="on" value="" /> -
- normal -
+ Bamboo
@@ -7828,8 +10474,8 @@ exports[`renders components/select/demo/option-label-center.tsx extend context c />
-
-
+ +
@@ -8163,13 +11111,8 @@ exports[`renders components/select/demo/option-label-center.tsx extend context c
-
-
-
-
-
-
-
- - - - - - Select a option - - -
-
-
-
- -
-
-
-
-
- -
+
, +] `; -exports[`renders components/select/demo/option-label-center.tsx extend context correctly 2`] = `[]`; +exports[`renders components/select/demo/option-label-center.tsx extend context correctly 2`] = ` +[ + "Warning: Multiple Field with path 'bamboo' set 'initialValue'. Can not decide which one to pick.", +] +`; exports[`renders components/select/demo/option-render.tsx extend context correctly 1`] = `
+Array [
- - + + + + + long, long, long piece of text + +
+ +
- -
-
-
+
+
+ + + + + + Select a option + + +
+ +
+
+
+
+
+ + + + + +
+ normal +
+
+
+
+ + +
+
+
+ +
+
+ +
+
+
+
+ + + + + + Select a option + + +
+ +
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+
+ + + + + + Bamboo + + +
+ + +
+
+
+
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+ +
+
, +
+ + + Hi + + + + + + + + + + + -
-
+
+ Hi +
@@ -2579,20 +3875,16 @@ exports[`renders components/select/demo/option-label-center.tsx correctly 1`] = aria-owns="undefined_list" autocomplete="off" class="ant-select-selection-search-input" - readonly="" role="combobox" - style="opacity:0" type="search" - unselectable="on" value="" /> -
- normal -
+ Bamboo
@@ -2650,17 +3942,176 @@ exports[`renders components/select/demo/option-label-center.tsx correctly 1`] =
-
-
+ + -
-
-
-
-
-
- - - - - - Select a option - - -
-
-
- -
-
+
, +] `; exports[`renders components/select/demo/option-render.tsx correctly 1`] = ` diff --git a/components/select/demo/option-label-center.tsx b/components/select/demo/option-label-center.tsx index d0b92de9d1..9634f28424 100644 --- a/components/select/demo/option-label-center.tsx +++ b/components/select/demo/option-label-center.tsx @@ -1,5 +1,15 @@ import React from 'react'; -import { Cascader, Select, Space, TreeSelect, Typography } from 'antd'; +import { + AutoComplete, + Cascader, + Flex, + Form, + Input, + Select, + Space, + TreeSelect, + Typography, +} from 'antd'; const options = [ { value: 'long', label: long, long, long piece of text }, @@ -8,69 +18,172 @@ const options = [ ]; const App: React.FC = () => ( - - - - - - - + - - + + + + + + + + + + + + {/* Test for align */} + + {/* Single */} + + + {/* Multiple */} + + + + ); export default App; diff --git a/components/select/style/index.ts b/components/select/style/index.ts index d207cfdc3d..af9053d355 100644 --- a/components/select/style/index.ts +++ b/components/select/style/index.ts @@ -146,6 +146,26 @@ const genBaseStyle: GenerateStyle = (token) => { }, }, + // ========================== Wrap =========================== + [`${componentCls}-selection-wrap`]: { + display: 'flex', + width: '100%', + position: 'relative', + + // https://github.com/ant-design/ant-design/issues/51669 + '&:after': { + content: '"\\a0"', + width: 0, + overflow: 'hidden', + }, + }, + + // ========================= Prefix ========================== + [`${componentCls}-prefix`]: { + flex: 'none', + marginInlineEnd: token.selectAffixPadding, + }, + // ========================== Clear ========================== [`${componentCls}-clear`]: { position: 'absolute', diff --git a/components/select/style/multiple.ts b/components/select/style/multiple.ts index 8e3fc00a82..29f8bbad5d 100644 --- a/components/select/style/multiple.ts +++ b/components/select/style/multiple.ts @@ -232,27 +232,46 @@ const genSelectionStyle = ( }, }, - [`${componentCls}-selection-wrap`]: { - width: '100%', - overflow: 'hidden', - }, - // ======================== Selections ======================== [`${componentCls}-selection-item`]: { height: multipleSelectorUnit.itemHeight, lineHeight: unit(multipleSelectorUnit.itemLineHeight), }, + // ========================== Wrap =========================== + [`${componentCls}-selection-wrap`]: { + alignSelf: 'flex-start', + + '&:after': { + lineHeight: unit(selectItemHeight), + marginBlock: INTERNAL_FIXED_ITEM_MARGIN, + }, + }, + // ========================== Input ========================== - [`${selectOverflowPrefixCls}-item + ${selectOverflowPrefixCls}-item`]: { + [`${componentCls}-prefix`]: { + marginInlineStart: token + .calc(token.inputPaddingHorizontalBase) + .sub(multipleSelectorUnit.basePadding) + .equal(), + }, + + [`${selectOverflowPrefixCls}-item + ${selectOverflowPrefixCls}-item, + ${componentCls}-prefix + ${componentCls}-selection-wrap + `]: { [`${componentCls}-selection-search`]: { marginInlineStart: 0, }, + [`${componentCls}-selection-placeholder`]: { + insetInlineStart: 0, + }, }, // https://github.com/ant-design/ant-design/issues/44754 + // Same as `wrap:after` [`${selectOverflowPrefixCls}-item-suffix`]: { - height: '100%', + minHeight: multipleSelectorUnit.itemHeight, + marginBlock: INTERNAL_FIXED_ITEM_MARGIN, }, [`${componentCls}-selection-search`]: { @@ -291,18 +310,14 @@ const genSelectionStyle = ( [`${componentCls}-selection-placeholder`]: { position: 'absolute', top: '50%', - insetInlineStart: token.inputPaddingHorizontalBase, + insetInlineStart: token + .calc(token.inputPaddingHorizontalBase) + .sub(multipleSelectorUnit.basePadding) + .equal(), insetInlineEnd: token.inputPaddingHorizontalBase, transform: 'translateY(-50%)', transition: `all ${token.motionDurationSlow}`, }, - - [`${componentCls}-prefix`]: { - height: multipleSelectorUnit.itemHeight, - lineHeight: unit(multipleSelectorUnit.itemLineHeight), - marginInlineStart: `calc(${unit(token.inputPaddingHorizontalBase)} - ${unit(multipleSelectorUnit.basePadding)})`, - marginInlineEnd: token.selectAffixPadding, - }, }, }; }; diff --git a/components/select/style/single.ts b/components/select/style/single.ts index 5487119aa9..204dd49295 100644 --- a/components/select/style/single.ts +++ b/components/select/style/single.ts @@ -6,7 +6,7 @@ import { mergeToken } from '../../theme/internal'; import type { SelectToken } from './token'; function genSizeStyle(token: SelectToken, suffix?: string): CSSObject { - const { componentCls, inputPaddingHorizontalBase, borderRadius, selectAffixPadding } = token; + const { componentCls, inputPaddingHorizontalBase, borderRadius } = token; const selectHeightWithoutBorder = token .calc(token.controlHeight) @@ -28,12 +28,6 @@ function genSizeStyle(token: SelectToken, suffix?: string): CSSObject { borderRadius, flex: '1 1 auto', - [`${componentCls}-selection-wrap`]: { - display: 'flex', - width: '100%', - position: 'relative', - }, - [`${componentCls}-selection-search`]: { position: 'absolute', inset: 0, @@ -47,8 +41,7 @@ function genSizeStyle(token: SelectToken, suffix?: string): CSSObject { [` ${componentCls}-selection-item, - ${componentCls}-selection-placeholder, - ${componentCls}-prefix + ${componentCls}-selection-placeholder `]: { display: 'block', padding: 0, @@ -62,10 +55,6 @@ function genSizeStyle(token: SelectToken, suffix?: string): CSSObject { pointerEvents: 'none', }, - [`${componentCls}-prefix`]: { - marginInlineEnd: selectAffixPadding, - }, - // For common baseline align [[ '&:after', @@ -101,6 +90,7 @@ function genSizeStyle(token: SelectToken, suffix?: string): CSSObject { [`${componentCls}-selector`]: { width: '100%', height: '100%', + alignItems: 'center', padding: `0 ${unit(inputPaddingHorizontalBase)}`, [`${componentCls}-selection-search-input`]: { diff --git a/components/select/style/variants.ts b/components/select/style/variants.ts index d1e21b813d..a759321701 100644 --- a/components/select/style/variants.ts +++ b/components/select/style/variants.ts @@ -13,6 +13,7 @@ const genBaseOutlinedStyle = ( hoverBorderHover: string; activeBorderColor: string; activeOutlineColor: string; + color: string; }, ): CSSObject => { const { componentCls, antCls, controlOutlineWidth } = token; @@ -33,6 +34,9 @@ const genBaseOutlinedStyle = ( boxShadow: `0 0 0 ${unit(controlOutlineWidth)} ${options.activeOutlineColor}`, outline: 0, }, + [`${componentCls}-prefix`]: { + color: options.color, + }, }, }; }; @@ -45,6 +49,7 @@ const genOutlinedStatusStyle = ( hoverBorderHover: string; activeBorderColor: string; activeOutlineColor: string; + color: string; }, ): CSSObject => ({ [`&${token.componentCls}-status-${options.status}`]: { @@ -59,6 +64,7 @@ const genOutlinedStyle = (token: SelectToken): CSSObject => ({ hoverBorderHover: token.hoverBorderColor, activeBorderColor: token.activeBorderColor, activeOutlineColor: token.activeOutlineColor, + color: token.colorText, }), ...genOutlinedStatusStyle(token, { @@ -67,6 +73,7 @@ const genOutlinedStyle = (token: SelectToken): CSSObject => ({ hoverBorderHover: token.colorErrorHover, activeBorderColor: token.colorError, activeOutlineColor: token.colorErrorOutline, + color: token.colorError, }), ...genOutlinedStatusStyle(token, { @@ -75,6 +82,7 @@ const genOutlinedStyle = (token: SelectToken): CSSObject => ({ hoverBorderHover: token.colorWarningHover, activeBorderColor: token.colorWarning, activeOutlineColor: token.colorWarningOutline, + color: token.colorWarning, }), [`&${token.componentCls}-disabled`]: { @@ -188,7 +196,7 @@ const genBorderlessStyle = (token: SelectToken): CSSObject => ({ '&-borderless': { [`${token.componentCls}-selector`]: { background: 'transparent', - borderColor: 'transparent', + border: `${unit(token.lineWidth)} ${token.lineType} transparent`, }, [`&${token.componentCls}-disabled`]: { @@ -204,13 +212,13 @@ const genBorderlessStyle = (token: SelectToken): CSSObject => ({ // Status [`&${token.componentCls}-status-error`]: { - [`${token.componentCls}-selection-item`]: { + [`${token.componentCls}-prefix, ${token.componentCls}-selection-item`]: { color: token.colorError, }, }, [`&${token.componentCls}-status-warning`]: { - [`${token.componentCls}-selection-item`]: { + [`${token.componentCls}-prefix, ${token.componentCls}-selection-item`]: { color: token.colorWarning, }, }, From a4c884cb3d0ddc3560801e851d3cbf363de686dd Mon Sep 17 00:00:00 2001 From: lijianan <574980606@qq.com> Date: Wed, 20 Nov 2024 15:03:07 +0800 Subject: [PATCH 19/27] chore: up release data (#51703) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 栗嘉男 --- CHANGELOG.en-US.md | 2 +- CHANGELOG.zh-CN.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index 4f0a5a874c..af572f9dad 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -17,7 +17,7 @@ tag: vVERSION ## 5.22.2 -`2024-11-19` +`2024-11-20` - 🐞 Fix Input.OTP focus from advancing when previous input is empty. [#51664](https://github.com/ant-design/ant-design/pull/51664) [@thecodesalim](https://github.com/thecodesalim) - 🐞 Adjust Modal function call not to scroll the confirm button when it get auto focused. [#51647](https://github.com/ant-design/ant-design/pull/51647) [@zombieJ](https://github.com/zombieJ) diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index ec6067b57d..51b93ebbbe 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -17,7 +17,7 @@ tag: vVERSION ## 5.22.2 -`2024-11-19` +`2024-11-20` - 🐞 修复 Input.OTP 组件在有非法输入时仍会切换到下一个输入框的问题。[#51664](https://github.com/ant-design/ant-design/pull/51664) [@thecodesalim](https://github.com/thecodesalim) - 🐞 调整 Modal 确认函数,使其在弹出后聚焦确认按钮时不要滚动窗体。[#51647](https://github.com/ant-design/ant-design/pull/51647) [@zombieJ](https://github.com/zombieJ) From 2c189d03ca2b2a5d6ef84419df48b06c1e1e6172 Mon Sep 17 00:00:00 2001 From: MadCcc Date: Wed, 20 Nov 2024 17:09:25 +0800 Subject: [PATCH 20/27] chore: update pre-publish (#51708) --- scripts/pre-publish.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/pre-publish.ts b/scripts/pre-publish.ts index 6d045c2dbe..a34b21b585 100644 --- a/scripts/pre-publish.ts +++ b/scripts/pre-publish.ts @@ -142,7 +142,7 @@ const runPrePublish = async () => { showMessage(`开始检查远程分支 ${currentBranch} 的 CI 状态`, true); const failureUrlList: string[] = []; - const { + let { data: { check_runs }, } = await octokit.checks.listForRef({ owner, @@ -150,6 +150,9 @@ const runPrePublish = async () => { ref: sha, }); showMessage(`远程分支 CI 状态(${check_runs.length}):`, 'succeed'); + check_runs = check_runs.filter( + (run) => !run.name.padEnd(36).includes('Check Virtual Regression Approval'), + ); check_runs.forEach((run) => { showMessage(` ${run.name.padEnd(36)} ${emojify(run.status)} ${emojify(run.conclusion || '')}`); if (blockStatus.some((status) => run.conclusion === status)) { From eb3fe50d9944ce6e1b4fef3fbe58f5e35269fd35 Mon Sep 17 00:00:00 2001 From: MadCcc <1075746765@qq.com> Date: Wed, 20 Nov 2024 22:26:02 +0800 Subject: [PATCH 21/27] chore: update pre-publish script --- scripts/pre-publish.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/pre-publish.ts b/scripts/pre-publish.ts index a34b21b585..cd129758b1 100644 --- a/scripts/pre-publish.ts +++ b/scripts/pre-publish.ts @@ -18,6 +18,8 @@ const blockStatus = ['failure', 'cancelled', 'timed_out'] as const; const spinner = { interval: 80, frames: ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'] }; const spinnies = new Spinnies({ spinner }); +const IGNORE_ACTIONS = ['Check Virtual Regression Approval', 'issue-remove-inactive']; + let spinniesId = 0; // `spinnies` 为按条目进度,需要做简单的封装变成接近 `ora` 的形态 @@ -150,8 +152,8 @@ const runPrePublish = async () => { ref: sha, }); showMessage(`远程分支 CI 状态(${check_runs.length}):`, 'succeed'); - check_runs = check_runs.filter( - (run) => !run.name.padEnd(36).includes('Check Virtual Regression Approval'), + check_runs = check_runs.filter((run) => + IGNORE_ACTIONS.every((action) => !run.name.includes(action)), ); check_runs.forEach((run) => { showMessage(` ${run.name.padEnd(36)} ${emojify(run.status)} ${emojify(run.conclusion || '')}`); From 1d743363b17b2c6dfc524ae0f7efa0cb75fccfbc Mon Sep 17 00:00:00 2001 From: MadCcc <1075746765@qq.com> Date: Thu, 21 Nov 2024 00:01:16 +0800 Subject: [PATCH 22/27] chore: update changelog date --- CHANGELOG.en-US.md | 2 +- CHANGELOG.zh-CN.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index af572f9dad..e98ac4fcb6 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -17,7 +17,7 @@ tag: vVERSION ## 5.22.2 -`2024-11-20` +`2024-11-21` - 🐞 Fix Input.OTP focus from advancing when previous input is empty. [#51664](https://github.com/ant-design/ant-design/pull/51664) [@thecodesalim](https://github.com/thecodesalim) - 🐞 Adjust Modal function call not to scroll the confirm button when it get auto focused. [#51647](https://github.com/ant-design/ant-design/pull/51647) [@zombieJ](https://github.com/zombieJ) diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index 51b93ebbbe..00d7ad0866 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -17,7 +17,7 @@ tag: vVERSION ## 5.22.2 -`2024-11-20` +`2024-11-21` - 🐞 修复 Input.OTP 组件在有非法输入时仍会切换到下一个输入框的问题。[#51664](https://github.com/ant-design/ant-design/pull/51664) [@thecodesalim](https://github.com/thecodesalim) - 🐞 调整 Modal 确认函数,使其在弹出后聚焦确认按钮时不要滚动窗体。[#51647](https://github.com/ant-design/ant-design/pull/51647) [@zombieJ](https://github.com/zombieJ) From 4dfa7ddf5ed998c61f4d43206ed1fb2afaf5d838 Mon Sep 17 00:00:00 2001 From: MadCcc <1075746765@qq.com> Date: Thu, 21 Nov 2024 01:50:33 +0800 Subject: [PATCH 23/27] chore: update pre-publish --- scripts/pre-publish.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/pre-publish.ts b/scripts/pre-publish.ts index cd129758b1..de8dbfbdde 100644 --- a/scripts/pre-publish.ts +++ b/scripts/pre-publish.ts @@ -150,6 +150,7 @@ const runPrePublish = async () => { owner, repo, ref: sha, + filter: 'all', }); showMessage(`远程分支 CI 状态(${check_runs.length}):`, 'succeed'); check_runs = check_runs.filter((run) => From 2116659f52ba9bdc083ab0956a36ad633ccaadce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E6=9C=BA=E5=99=A8=E4=BA=BA?= Date: Thu, 21 Nov 2024 10:14:55 +0800 Subject: [PATCH 24/27] chore: use single update status of diff action --- .../visual-regression-diff-approver.yml | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/workflows/visual-regression-diff-approver.yml b/.github/workflows/visual-regression-diff-approver.yml index 5b0fbb8f7a..4c8b4b88e6 100644 --- a/.github/workflows/visual-regression-diff-approver.yml +++ b/.github/workflows/visual-regression-diff-approver.yml @@ -77,15 +77,26 @@ jobs: const mergedStatus = diffPassed ? 'success' : hasDiffFailed ? 'failure' : 'pending'; console.log('Status:', mergedStatus); - await github.rest.repos.createCommitStatus({ - owner: context.repo.owner, - repo: context.repo.repo, - sha: prHeadSha, - state: mergedStatus, - context: 'Visual Regression Diff Wait Approve', - description: diffPassed ? 'Visual diff is acceptable' : 'Visual diff is not pass', + const { data: currentStatuses } = await github.rest.repos.listCommitStatusesForRef({ + owner: context.repo.owner, + repo: context.repo.repo, + ref: prHeadSha, }); + const currentStatus = currentStatuses.find(status => status.context === 'Visual Regression Diff Wait Approve'); + if (currentStatus && currentStatus.state === mergedStatus) { + console.log('Status has not changed, no need to update:', currentStatus.state); + } else { + await github.rest.repos.createCommitStatus({ + owner: context.repo.owner, + repo: context.repo.repo, + sha: prHeadSha, + state: mergedStatus, + context: 'Visual Regression Diff Wait Approve', + description: diffPassed ? 'Visual diff is acceptable' : 'Visual diff is not pass', + }); + } + if (hasDiffSuccess || (hasDiffFailed && hasMemberApprove)) { return 'success'; } else if (hasDiffFailed) { From 58b7d03d8b4dc2165dabfc9fbebdd1802488ff11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E7=88=B1=E5=90=83=E7=99=BD=E8=90=9D?= =?UTF-8?q?=E5=8D=9C?= Date: Thu, 21 Nov 2024 14:22:05 +0800 Subject: [PATCH 25/27] chore: tmp lock `@swc/types` ver (#51722) * chore: tmp lock types ver * chore: force lock --- package.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/package.json b/package.json index d979a56eca..7949df79bf 100644 --- a/package.json +++ b/package.json @@ -343,5 +343,11 @@ "title": "Ant Design", "tnpm": { "mode": "npm" + }, + "overrides": { + "@swc/types": "0.1.12" + }, + "resolutions": { + "@swc/types": "0.1.12" } } From 657a91362eded1ea9a5d157e2e49e0f175565640 Mon Sep 17 00:00:00 2001 From: Jee <36779802+985563349@users.noreply.github.com> Date: Thu, 21 Nov 2024 14:44:21 +0800 Subject: [PATCH 26/27] chore: optimize sort gradient non-numeric judgments (#51720) Co-authored-by: lijianan <574980606@qq.com> --- components/progress/Line.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/progress/Line.tsx b/components/progress/Line.tsx index a59d4e4d85..e37e5c03b3 100644 --- a/components/progress/Line.tsx +++ b/components/progress/Line.tsx @@ -34,7 +34,7 @@ export const sortGradient = (gradients: StringGradients) => { let tempArr: { key: number; value?: string }[] = []; Object.keys(gradients).forEach((key) => { const formattedKey = parseFloat(key.replace(/%/g, '')); - if (!isNaN(formattedKey)) { + if (!Number.isNaN(formattedKey)) { tempArr.push({ key: formattedKey, value: gradients[key] }); } }); From 75cc302b9c8ac6baf850ffa8edbe60306fb4734b Mon Sep 17 00:00:00 2001 From: lijianan <574980606@qq.com> Date: Thu, 21 Nov 2024 17:52:09 +0800 Subject: [PATCH 27/27] chore: up ChangeLog (#51719) --- CHANGELOG.en-US.md | 2 ++ CHANGELOG.zh-CN.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index e98ac4fcb6..4ec4aceabb 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -26,6 +26,8 @@ tag: vVERSION - 🐞 Fix Button custom icon not center-aligned. [#51652](https://github.com/ant-design/ant-design/pull/51652) [@afc163](https://github.com/afc163) - 🐞 Fix Table `getCheckboxProps` event handlers being overridden by internal selection logic. [#51661](https://github.com/ant-design/ant-design/pull/51661) [@Zyf665](https://github.com/Zyf665) - 🐞 Fix Tree that `onCheck` and `onSelect` were not properly triggered. [#51448](https://github.com/ant-design/ant-design/pull/51448) [@Wxh16144](https://github.com/Wxh16144) +- 🐞 Fix vertical alignment of clear icon in Input component. [#51700](https://github.com/ant-design/ant-design/pull/51700) [@jynxio](https://github.com/jynxio) +- 🐞 Fix Select with `prefix` style issue with color, line break, status error. [#51694](https://github.com/ant-design/ant-design/pull/51694) [@zombieJ](https://github.com/zombieJ) - 🌐 Localization - 🇷🇺 Add support for Russian translation. [#51619](https://github.com/ant-design/ant-design/pull/51619) [@avvakumovid](https://github.com/avvakumovid) - 🇮🇹 Add support for Italian translation in TimePicker. [#51685](https://github.com/ant-design/ant-design/pull/51685) [@LorenzoCardinali](https://github.com/LorenzoCardinali) diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index 00d7ad0866..41a12a0d03 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -26,6 +26,8 @@ tag: vVERSION - 🐞 修复 Button 中使用自定义三方图标库时图标未居中的问题。[#51652](https://github.com/ant-design/ant-design/pull/51652) [@afc163](https://github.com/afc163) - 🐞 修复 Table 组件 `getCheckboxProps` 中的事件处理器被内部选择逻辑覆盖的问题。[#51661](https://github.com/ant-design/ant-design/pull/51661) [@Zyf665](https://github.com/Zyf665) - 🐞 修复 Tree 组件的 `onCheck` 和 `onSelect` 事件没有被正确触发的问题。[#51448](https://github.com/ant-design/ant-design/pull/51448) [@Wxh16144](https://github.com/Wxh16144) +- 🐞 修复 Input 组件的清除按钮未能垂直居中的问题。[#51700](https://github.com/ant-design/ant-design/pull/51700) [@jynxio](https://github.com/jynxio) +- 🐞 修复 Select 组件的 `prefix` 组合导致的颜色、折行、状态等一系列样式问题。[#51694](https://github.com/ant-design/ant-design/pull/51694) [@zombieJ](https://github.com/zombieJ) - 🌐 本地化 - 🇷🇺 添加了俄语翻译支持。[#51619](https://github.com/ant-design/ant-design/pull/51619) [@avvakumovid](https://github.com/avvakumovid) - 🇮🇹 为 TimePicker 添加了意大利语翻译。[#51685](https://github.com/ant-design/ant-design/pull/51685) [@LorenzoCardinali](https://github.com/LorenzoCardinali)