diff --git a/components/_util/wave/WaveEffect.tsx b/components/_util/wave/WaveEffect.tsx index 542bea3f2b84..c47b575b9845 100644 --- a/components/_util/wave/WaveEffect.tsx +++ b/components/_util/wave/WaveEffect.tsx @@ -4,7 +4,8 @@ import CSSMotion from 'rc-motion'; import raf from 'rc-util/lib/raf'; import { composeRef } from 'rc-util/lib/ref'; -import { getReactRender, type UnmountType } from '../../config-provider/UnstableContext'; +import { getReactRender } from '../../config-provider/UnstableContext'; +import type { UnmountType } from '../../config-provider/UnstableContext'; import { TARGET_CLS } from './interface'; import type { ShowWaveEffect } from './interface'; import { getTargetWaveColor } from './util'; diff --git a/components/auto-complete/index.en-US.md b/components/auto-complete/index.en-US.md index 9151e2f5cefa..c4f4f95f06f4 100644 --- a/components/auto-complete/index.en-US.md +++ b/components/auto-complete/index.en-US.md @@ -61,8 +61,10 @@ Common props ref:[Common props](/docs/react/common-props) | options | Select options. Will get better perf than jsx definition | { label, value }\[] | - | | | placeholder | The placeholder of input | string | - | | | status | Set validation status | 'error' \| 'warning' | - | 4.19.0 | +| size | The size of the input box | `large` \| `middle` \| `small` | - | | | value | Selected option | string | - | | | variant | Variants of input | `outlined` \| `borderless` \| `filled` | `outlined` | 5.13.0 | +| virtual | Disable virtual scroll when set to false | boolean | true | 4.1.0 | | onBlur | Called when leaving the component | function() | - | | | onChange | Called when selecting an option or changing an input value | function(value) | - | | | onDropdownVisibleChange | Call when dropdown open | function(open) | - | | @@ -70,6 +72,8 @@ Common props ref:[Common props](/docs/react/common-props) | onSearch | Called when searching items | function(value) | - | | | onSelect | Called when a option is selected. param is option's value and option instance | function(value, option) | - | | | onClear | Called when clear | function | - | 4.6.0 | +| onInputKeyDown | Called when key pressed | (event: KeyboardEvent) => void | - | | +| onPopupScroll | Called when dropdown scrolls | (event: UIEvent) => void | - | | ## Methods diff --git a/components/auto-complete/index.zh-CN.md b/components/auto-complete/index.zh-CN.md index 10dd176f1270..e7e0d23f5e3f 100644 --- a/components/auto-complete/index.zh-CN.md +++ b/components/auto-complete/index.zh-CN.md @@ -62,8 +62,10 @@ demo: | options | 数据化配置选项内容,相比 jsx 定义会获得更好的渲染性能 | { label, value }\[] | - | | | placeholder | 输入框提示 | string | - | | | status | 设置校验状态 | 'error' \| 'warning' | - | 4.19.0 | +| size | 控件大小 | `large` \| `middle` \| `small` | - | | | value | 指定当前选中的条目 | string | - | | | variant | 形态变体 | `outlined` \| `borderless` \| `filled` | `outlined` | 5.13.0 | +| virtual | 设置 false 时关闭虚拟滚动 | boolean | true | 4.1.0 | | onBlur | 失去焦点时的回调 | function() | - | | | onChange | 选中 option,或 input 的 value 变化时,调用此函数 | function(value) | - | | | onDropdownVisibleChange | 展开下拉菜单的回调 | function(open) | - | | @@ -71,6 +73,8 @@ demo: | onSearch | 搜索补全项的时候调用 | function(value) | - | | | onSelect | 被选中时调用,参数为选中项的 value 值 | function(value, option) | - | | | onClear | 清除内容时的回调 | function | - | 4.6.0 | +| onInputKeyDown | 按键按下时回调 | (event: KeyboardEvent) => void | - | | +| onPopupScroll | 下拉列表滚动时的回调 | (event: UIEvent) => void | - | | ## 方法 diff --git a/components/button/button-group.tsx b/components/button/button-group.tsx index 056b7eca2e0e..3920d382065c 100644 --- a/components/button/button-group.tsx +++ b/components/button/button-group.tsx @@ -24,18 +24,16 @@ const ButtonGroup: React.FC = (props) => { const [, , hashId] = useToken(); - let sizeCls = ''; - - switch (size) { - case 'large': - sizeCls = 'lg'; - break; - case 'small': - sizeCls = 'sm'; - break; - default: - // Do nothing - } + const sizeCls = React.useMemo(() => { + switch (size) { + case 'large': + return 'lg'; + case 'small': + return 'sm'; + default: + return ''; + } + }, [size]); if (process.env.NODE_ENV !== 'production') { const warning = devUseWarning('Button.Group'); diff --git a/components/qr-code/index.tsx b/components/qr-code/index.tsx index bcc9e2d160ad..4445ad14bdac 100644 --- a/components/qr-code/index.tsx +++ b/components/qr-code/index.tsx @@ -1,4 +1,4 @@ -import React, { useContext, type AriaAttributes } from 'react'; +import React, { useContext } from 'react'; import { QRCodeCanvas, QRCodeSVG } from '@rc-component/qrcode'; import classNames from 'classnames'; import omit from 'rc-util/lib/omit'; @@ -50,9 +50,10 @@ const QRCode: React.FC = (props) => { }; const a11yProps = pickAttrs(rest, true); - const restProps = omit, keyof AriaAttributes>( + + const restProps = omit, keyof React.AriaAttributes>( rest, - Object.keys(a11yProps) as Array, + Object.keys(a11yProps) as (keyof React.AriaAttributes)[], ); const qrCodeProps = { diff --git a/components/space/Compact.tsx b/components/space/Compact.tsx index 7295c757bdcf..a5d870bfb17c 100644 --- a/components/space/Compact.tsx +++ b/components/space/Compact.tsx @@ -43,9 +43,12 @@ export const useCompactItemContext = (prefixCls: string, direction: DirectionTyp }; }; -export const NoCompactStyle: React.FC> = ({ children }) => ( - {children} -); +export const NoCompactStyle: React.FC> = (props) => { + const { children } = props; + return ( + {children} + ); +}; export interface SpaceCompactProps extends React.HTMLAttributes { prefixCls?: string; @@ -55,12 +58,16 @@ export interface SpaceCompactProps extends React.HTMLAttributes rootClassName?: string; } -const CompactItem: React.FC> = ({ - children, - ...otherProps -}) => ( - {children} -); +const CompactItem: React.FC> = (props) => { + const { children, ...others } = props; + return ( + (() => others, [others])} + > + {children} + + ); +}; const Compact: React.FC = (props) => { const { getPrefixCls, direction: directionConfig } = React.useContext(ConfigContext); @@ -95,6 +102,7 @@ const Compact: React.FC = (props) => { const compactItemContext = React.useContext(SpaceCompactItemContext); const childNodes = toArray(children); + const nodes = React.useMemo( () => childNodes.map((child, i) => { diff --git a/package.json b/package.json index 188c94ae8764..4b310f4d235d 100644 --- a/package.json +++ b/package.json @@ -161,7 +161,7 @@ "@ant-design/happy-work-theme": "^1.0.0", "@ant-design/tools": "^18.0.3", "@ant-design/v5-patch-for-react-19": "^1.0.2", - "@antfu/eslint-config": "^3.11.2", + "@antfu/eslint-config": "^4.0.0", "@antv/g6": "^4.8.24", "@biomejs/biome": "^1.9.4", "@codecov/webpack-plugin": "^1.4.0", @@ -348,11 +348,5 @@ "title": "Ant Design", "tnpm": { "mode": "npm" - }, - "overrides": { - "react-intl": "7.0.4" - }, - "resolutions": { - "react-intl": "7.0.4" } } diff --git a/webpack.config.js b/webpack.config.js index 5ac3a0814cae..88f6a7981ab2 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -62,6 +62,7 @@ function addPluginsForProduction(config) { enableBundleAnalysis: process.env.CODECOV_TOKEN !== undefined, bundleName: 'antd.min', uploadToken: process.env.CODECOV_TOKEN, + gitService: "github", }), new CircularDependencyPlugin({ failOnError: true,