Merge pull request #49425 from ant-design/master

chore: merge master into feature
This commit is contained in:
lijianan 2024-06-15 16:41:47 +08:00 committed by GitHub
commit 9c91bdb9a8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
58 changed files with 645 additions and 282 deletions

View File

@ -114,6 +114,7 @@ const ThemeColorPicker: React.FC<ColorPickerProps> = ({ value, onChange, id }) =
<input
type="radio"
name={picker ? 'picker' : 'color'}
aria-label={color}
tabIndex={picker ? -1 : 0}
onClick={(e) => e.stopPropagation()}
/>

View File

@ -474,7 +474,7 @@ const Theme: React.FC = () => {
filter:
closestColor === DEFAULT_COLOR ? undefined : rgbToColorMatrix(logoColor),
}}
alt=""
alt="antd logo"
/>
</div>
<h1>Ant Design 5.0</h1>

View File

@ -1,4 +1,4 @@
/* eslint-disable global-require */
/* eslint-disable global-require, import/no-unresolved */
import React from 'react';
import { BugOutlined, HistoryOutlined } from '@ant-design/icons';
import { Button, Drawer, Grid, Popover, Timeline, Typography } from 'antd';
@ -142,9 +142,11 @@ interface ChangelogInfo {
}
const useChangelog = (componentPath: string, lang: 'cn' | 'en'): ChangelogInfo[] => {
const logFileName = `components-changelog-${lang}.json`;
const data = useFetch({
key: `component-changelog-${lang}`,
request: () => import(`../../../preset/components-changelog-${lang}.json`),
request: () => import(`../../../preset/${logFileName}`),
});
return React.useMemo(() => {
const component = componentPath.replace(/-/g, '');

View File

@ -6,7 +6,7 @@ import throttle from 'lodash/throttle';
import scrollTo from '../../../../components/_util/scrollTo';
const listenerEvents = ['scroll', 'resize'] as const;
const listenerEvents: (keyof WindowEventMap)[] = ['scroll', 'resize'];
const useStyle = createStyles(({ token, css }) => {
const { boxShadowSecondary, antCls } = token;

View File

@ -181,26 +181,6 @@ const RoutesPlugin = (api: IApi) => {
// exclude dynamic route path, to avoid deploy failed by `:id` directory
.filter((f) => !f.path.includes(':'))
.map((file) => {
let globalStyles = '';
// Debug for file content: uncomment this if need check raw out
// const tmpFileName = `_${file.path.replace(/\//g, '-')}`;
// const tmpFilePath = path.join(api.paths.absOutputPath, tmpFileName);
// fs.writeFileSync(tmpFilePath, file.content, 'utf8');
// extract all emotion style tags from body
file.content = file.content.replace(
/<style (data-emotion|data-sandpack)[\S\s]+?<\/style>/g,
(s) => {
globalStyles += s;
return '';
},
);
// insert emotion style tags to head
file.content = file.content.replace('</head>', `${globalStyles}</head>`);
// 1. 提取 antd-style 样式
const styles = extractEmotionStyle(file.content);
@ -217,30 +197,6 @@ const RoutesPlugin = (api: IApi) => {
file.content = addLinkStyle(file.content, cssFile);
});
// Insert antd style to head
const matchRegex = /<style data-type="antd-cssinjs">([\S\s]+?)<\/style>/;
const matchList = file.content.match(matchRegex) || [];
// Init to order the `@layer`
let antdStyle = '@layer global, antd;';
matchList.forEach((text) => {
file.content = file.content.replace(text, '');
antdStyle += text.replace(matchRegex, '$1');
});
const cssFile = writeCSSFile('antd', antdStyle, antdStyle);
file.content = addLinkStyle(file.content, cssFile, true);
// Insert antd cssVar to head
const cssVarMatchRegex = /<style data-type="antd-css-var"[\S\s]+?<\/style>/;
const cssVarMatchList = file.content.match(cssVarMatchRegex) || [];
cssVarMatchList.forEach((text) => {
file.content = file.content.replace(text, '');
file.content = file.content.replace('<head>', `<head>${text}`);
});
return file;
}),
);

View File

@ -202,7 +202,7 @@ const Footer: React.FC = () => {
src="https://gw.alipayobjects.com/zos/rmsportal/XuVpGqBFxXplzvLjJBZB.svg"
width={16}
height={16}
alt="yuque"
alt="yuque logo"
/>
),
title: <FormattedMessage id="app.footer.yuque.repo" />,
@ -227,7 +227,7 @@ const Footer: React.FC = () => {
src="https://gw.alipayobjects.com/zos/rmsportal/mZBWtboYbnMkTBaRIuWQ.png"
width={16}
height={16}
alt="seeconf"
alt="seeconf logo"
/>
),
title: 'SEE Conf',
@ -310,7 +310,7 @@ const Footer: React.FC = () => {
src="https://gw.alipayobjects.com/zos/rmsportal/nBVXkrFdWHxbZlmMbsaH.svg"
width={22}
height={22}
alt="Ant XTech"
alt="Ant XTech logo"
/>
),
title: <FormattedMessage id="app.footer.more-product" />,
@ -321,7 +321,7 @@ const Footer: React.FC = () => {
src="https://gw.alipayobjects.com/zos/rmsportal/XuVpGqBFxXplzvLjJBZB.svg"
width={16}
height={16}
alt="yuque"
alt="yuque logo"
/>
),
title: <FormattedMessage id="app.footer.yuque" />,
@ -335,7 +335,7 @@ const Footer: React.FC = () => {
src="https://gw.alipayobjects.com/zos/antfincdn/nc7Fc0XBg5/8a6844f5-a6ed-4630-9177-4fa5d0b7dd47.png"
width={16}
height={16}
alt="AntV"
alt="AntV logo"
/>
),
title: 'AntV',
@ -344,7 +344,7 @@ const Footer: React.FC = () => {
openExternal: true,
},
{
icon: <img src="https://www.eggjs.org/logo.svg" alt="Egg" width={16} height={16} />,
icon: <img src="https://www.eggjs.org/logo.svg" alt="Egg logo" width={16} height={16} />,
title: 'Egg',
url: 'https://eggjs.org',
description: <FormattedMessage id="app.footer.egg.slogan" />,
@ -356,7 +356,7 @@ const Footer: React.FC = () => {
src="https://gw.alipayobjects.com/zos/rmsportal/DMDOlAUhmktLyEODCMBR.ico"
width={16}
height={16}
alt="kitchen"
alt="Kitchen logo"
/>
),
title: 'Kitchen',
@ -370,7 +370,7 @@ const Footer: React.FC = () => {
src="https://mdn.alipayobjects.com/huamei_j9rjmc/afts/img/A*3ittT5OEo2gAAAAAAAAAAAAADvGmAQ/original"
width={16}
height={16}
alt="Galacean"
alt="Galacean logo"
/>
),
title: <FormattedMessage id="app.footer.galacean" />,
@ -384,7 +384,7 @@ const Footer: React.FC = () => {
src="https://gw.alipayobjects.com/zos/rmsportal/nBVXkrFdWHxbZlmMbsaH.svg"
width={16}
height={16}
alt="xtech"
alt="xtech logo"
/>
),
title: <FormattedMessage id="app.footer.xtech" />,

View File

@ -8,13 +8,20 @@ import { version } from './package.json';
export default defineConfig({
plugins: ['dumi-plugin-color-chunk'],
manifest: {},
conventionRoutes: {
// to avoid generate routes for .dumi/pages/index/components/xx
exclude: [new RegExp('index/components/')],
},
ssr: process.env.NODE_ENV === 'production' ? {} : false,
ssr:
process.env.NODE_ENV === 'production'
? {
builder: 'mako',
}
: false,
hash: true,
mfsu: false,
mako: {},
crossorigin: {},
outputPath: '_site',
favicons: ['https://gw.alipayobjects.com/zos/rmsportal/rlpTLlbMzTNYuZGGCVYM.png'],

View File

@ -61,7 +61,7 @@ jobs:
steps:
# We need get PR id first
- name: download pr artifact
uses: dawidd6/action-download-artifact@v5
uses: dawidd6/action-download-artifact@v6
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
run_id: ${{ github.event.workflow_run.id }}
@ -75,7 +75,7 @@ jobs:
# Download site artifact
- name: download site artifact
if: ${{ fromJSON(needs.upstream-workflow-summary.outputs.build-success) }}
uses: dawidd6/action-download-artifact@v5
uses: dawidd6/action-download-artifact@v6
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
run_id: ${{ github.event.workflow_run.id }}

View File

@ -51,8 +51,12 @@ jobs:
if: steps.node_modules_cache_id.outputs.cache-hit != 'true'
run: npm ci
visual-diff-report:
name: visual-diff report
############################ Generate Snapshot ###########################
visual-diff-snapshot:
name: visual-diff snapshot
strategy:
matrix:
shard: ['1/2', '2/2']
runs-on: ubuntu-latest
needs: setup
steps:
@ -80,10 +84,47 @@ jobs:
run: |
node node_modules/puppeteer/install.mjs
npm run version
npm run test:image
npm run test:image -- --shard=${{matrix.shard}}
env:
NODE_OPTIONS: "--max_old_space_size=4096"
- uses: actions/upload-artifact@v4
name: artifact snapshot
with:
name: snapshot-artifacts-${{ strategy.job-index }}
path: imageSnapshots/
retention-days: 2
############################### Diff Images ##############################
visual-diff-report:
name: visual-diff report
runs-on: ubuntu-latest
needs: visual-diff-snapshot
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- name: restore cache from package-lock.json
uses: actions/cache@v4
with:
path: package-temp-dir
key: lock-${{ github.sha }}
- name: restore cache from node_modules
uses: actions/cache@v4
with:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
- uses: actions/download-artifact@v4
with:
pattern: snapshot-artifacts-*
merge-multiple: true
path: imageSnapshots/
# Execute visual regression diff task and zip then
# output as visualRegressionReport.tar.gz
- name: visual regression diff
@ -112,4 +153,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: visual-regression-diff-ref
path: ./visual-regression-pr-id.txt
path: ./visual-regression-pr-id.txt

View File

@ -68,7 +68,7 @@ jobs:
# We need get persist-index first
- name: download image snapshot artifact
uses: dawidd6/action-download-artifact@v5
uses: dawidd6/action-download-artifact@v6
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
run_id: ${{ github.event.workflow_run.id }}
@ -84,7 +84,7 @@ jobs:
- name: download report artifact
id: download_report
if: ${{ needs.upstream-workflow-summary.outputs.build-status == 'success' || needs.upstream-workflow-summary.outputs.build-status == 'failure' }}
uses: dawidd6/action-download-artifact@v5
uses: dawidd6/action-download-artifact@v6
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
run_id: ${{ github.event.workflow_run.id }}

View File

@ -65,7 +65,7 @@ jobs:
# We need get persist key first
- name: Download Visual Regression Ref
uses: dawidd6/action-download-artifact@v5
uses: dawidd6/action-download-artifact@v6
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
run_id: ${{ github.event.workflow_run.id }}
@ -79,7 +79,7 @@ jobs:
- name: Download Visual-Regression Artifact
if: ${{ fromJSON(needs.upstream-workflow-summary.outputs.build-success) }}
uses: dawidd6/action-download-artifact@v5
uses: dawidd6/action-download-artifact@v6
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
run_id: ${{ github.event.workflow_run.id }}

View File

@ -16,6 +16,32 @@ tag: vVERSION
---
## 5.18.1
`2024-06-12`
- Typography
- 🐞 Fix Typography component's `ellipsis` not working properly in `pre` tag. [#49168](https://github.com/ant-design/ant-design/pull/49168) [@nova1751](https://github.com/nova1751)
- 🐞 Fix Typography `ellipsis` sometimes not working in Safari. [#49221](https://github.com/ant-design/ant-design/pull/49221)
- 🐞 Fix Space `size` setting to 0 did not take effect. [#49192](https://github.com/ant-design/ant-design/pull/49192) [@coding-ice](https://github.com/coding-ice)
- 🐞 Fix `padding` of Progress text is invalid in cssinjs. [#49250](https://github.com/ant-design/ant-design/pull/49250) [@vagusX](https://github.com/vagusX)
- 🐞 Fix Modal close button's `zIndex` being incorrect in `cssVar` mode. [#49238](https://github.com/ant-design/ant-design/pull/49238)
- 🐞 Fix Image `width` `height` being applied to preview images. [#49259](https://github.com/ant-design/ant-design/pull/49259) [@nova1751](https://github.com/nova1751)
- 🐞 Fix the icon of the Pagination page switcher disappears when hovering. [#49262](https://github.com/ant-design/ant-design/pull/49262)
- 🐞 Fix Mentions not responding to Enter event when `loading=true`. [#49292](https://github.com/ant-design/ant-design/pull/49292) [@wanpan11](https://github.com/wanpan11)
- 🐞 Fix Notification did not inherit App config properties. [#49339](https://github.com/ant-design/ant-design/pull/49339) [@hemengke1997](https://github.com/hemengke1997)
- 💄 Fix the text color of Drawer was incorrect in dark mode. [#49217](https://github.com/ant-design/ant-design/pull/49217)
- 💄 Fix the style was not visible and the `percent` progress was not passed when customizing the `indicator` of Spin. [#49211](https://github.com/ant-design/ant-design/pull/49211) [@wanpan11](https://github.com/wanpan11)
- DatePicker
- 🐞 Fix the `placement` property of DatePicker/TimePicker was invalid. [#49303](https://github.com/ant-design/ant-design/pull/49303)
- 💄 Fix the content in the DatePicker header area is not centered. [#49332](https://github.com/ant-design/ant-design/pull/49332)
- TypeScript
- 🤖 Mentions added new export type `MentionsProps`. [#49281](https://github.com/ant-design/ant-design/pull/49281) [@thinkasany](https://github.com/thinkasany)
- 🤖 Remove duplicate union type from Statistic. [#49218](https://github.com/ant-design/ant-design/pull/49218) [@thinkasany](https://github.com/thinkasany)
- 🌐 Locales
- 🇲🇾 Add Table、Form、Tour etc. ms_MY locale. [#49353](https://github.com/ant-design/ant-design/pull/49353) [@cs-gavin-huang](https://github.com/cs-gavin-huang)
- 🇦🇿 Add DatePicker az_AZ locale. [#49247](https://github.com/ant-design/ant-design/pull/49247) [@sabitalizade](https://github.com/sabitalizade)
## 5.18.0
`2024-06-03`

View File

@ -15,6 +15,32 @@ tag: vVERSION
---
## 5.18.1
`2024-06-12`
- Typography
- 🐞 修复 Typography 组件的 `ellipsis``pre` 标签中没有正常工作的问题。[#49168](https://github.com/ant-design/ant-design/pull/49168) [@nova1751](https://github.com/nova1751)
- 🐞 修复 Typography `ellipsis` 在 Safari 中有时不生效的问题。[#49221](https://github.com/ant-design/ant-design/pull/49221)
- 🐞 修复 Space `size` 设置 0 不生效的问题。[#49192](https://github.com/ant-design/ant-design/pull/49192) [@coding-ice](https://github.com/coding-ice)
- 🐞 修复 Progress 文本的 padding 在 cssinjs 下单位失效问题。[#49250](https://github.com/ant-design/ant-design/pull/49250) [@vagusX](https://github.com/vagusX)
- 🐞 修复 Modal 关闭按钮的 `zIndex``cssVar` 模式下不正确的问题。[#49238](https://github.com/ant-design/ant-design/pull/49238)
- 🐞 修复 Image `width` `height` 被应用到预览图片上的问题。[#49259](https://github.com/ant-design/ant-design/pull/49259) [@nova1751](https://github.com/nova1751)
- 🐞 修复 Pagination 页码切换器 hover 时图标消失的问题。[#49262](https://github.com/ant-design/ant-design/pull/49262)
- 🐞 修复 Mentions 当 `loading=true` 时不响应 Enter 事件的问题。[#49292](https://github.com/ant-design/ant-design/pull/49292) [@wanpan11](https://github.com/wanpan11)
- 🐞 修复 Notification 没有继承 App config 属性的问题。[#49339](https://github.com/ant-design/ant-design/pull/49339) [@hemengke1997](https://github.com/hemengke1997)
- 💄 修复 Drawer 在暗黑模式下,文本颜色不正确的问题。[#49217](https://github.com/ant-design/ant-design/pull/49217)
- 💄 修复 Spin 自定义 `indicator` 时,样式不可见以及 `percent` 进度没有传递的问题。[#49211](https://github.com/ant-design/ant-design/pull/49211) [@wanpan11](https://github.com/wanpan11)
- DatePicker
- 🐞 修复 DatePicker/TimePicker `placement` 属性失效的问题。[#49303](https://github.com/ant-design/ant-design/pull/49303)
- 💄 修复 DatePicker 头部区域内容不居中对齐的问题。[#49332](https://github.com/ant-design/ant-design/pull/49332)
- TypeScript
- 🤖 Mentions 新增导出类型 `MentionsProps`。[#49281](https://github.com/ant-design/ant-design/pull/49281) [@thinkasany](https://github.com/thinkasany)
- 🤖 移除 Statistic 重复的联合类型。[#49218](https://github.com/ant-design/ant-design/pull/49218) [@thinkasany](https://github.com/thinkasany)
- 🌐 国际化
- 🇲🇾 补充 Table、Form、Tour 等 ms_MY 文案。[#49353](https://github.com/ant-design/ant-design/pull/49353) [@cs-gavin-huang](https://github.com/cs-gavin-huang)
- 🇦🇿 补充 DatePicker az_AZ 文案。[#49247](https://github.com/ant-design/ant-design/pull/49247) [@sabitalizade](https://github.com/sabitalizade)
## 5.18.0
`2024-06-03`

View File

@ -2,8 +2,7 @@ import getScroll from '../getScroll';
describe('getScroll', () => {
it('getScroll target null', () => {
expect(getScroll(null, true)).toBe(0);
expect(getScroll(null, false)).toBe(0);
expect(getScroll(null)).toBe(0);
});
it('getScroll window', () => {
@ -11,9 +10,8 @@ describe('getScroll', () => {
window.pageXOffset = x;
window.pageYOffset = y;
});
window.scrollTo(200, 400);
expect(getScroll(window, true)).toBe(400);
expect(getScroll(window, false)).toBe(200);
window.scrollTo(0, 400);
expect(getScroll(window)).toBe(400);
scrollToSpy.mockRestore();
});
@ -22,9 +20,8 @@ describe('getScroll', () => {
document.documentElement.scrollLeft = x;
document.documentElement.scrollTop = y;
});
window.scrollTo(200, 400);
expect(getScroll(document, true)).toBe(400);
expect(getScroll(document, false)).toBe(200);
window.scrollTo(0, 400);
expect(getScroll(document)).toBe(400);
scrollToSpy.mockRestore();
});
@ -34,9 +31,8 @@ describe('getScroll', () => {
div.scrollLeft = x;
div.scrollTop = y;
});
window.scrollTo(200, 400);
expect(getScroll(div, true)).toBe(400);
expect(getScroll(div, false)).toBe(200);
window.scrollTo(0, 400);
expect(getScroll(div)).toBe(400);
scrollToSpy.mockRestore();
});
@ -49,9 +45,8 @@ describe('getScroll', () => {
div.documentElement.scrollLeft = x;
div.documentElement.scrollTop = y;
});
window.scrollTo(200, 400);
expect(getScroll(div, true)).toBe(400);
expect(getScroll(div, false)).toBe(200);
window.scrollTo(0, 400);
expect(getScroll(div)).toBe(400);
scrollToSpy.mockRestore();
});
});

View File

@ -1,9 +0,0 @@
/** @jest-environment node */
import getScroll from '../getScroll';
describe('getScroll node', () => {
it('getScroll return 0 in node environment', async () => {
expect(getScroll(null, true)).toBe(0);
expect(getScroll(null, false)).toBe(0);
});
});

View File

@ -19,7 +19,7 @@ describe('Table', () => {
let calledTimes = 0;
const Test = ({ depName }: { depName: string }) => {
const Test: React.FC<{ depName?: string }> = ({ depName }) => {
useUniqueMemo(() => {
calledTimes += 1;
return depName;

View File

@ -2,32 +2,31 @@ export function isWindow(obj: any): obj is Window {
return obj !== null && obj !== undefined && obj === obj.window;
}
export default function getScroll(
target: HTMLElement | Window | Document | null,
top: boolean,
): number {
const getScroll = (target: HTMLElement | Window | Document | null): number => {
if (typeof window === 'undefined') {
return 0;
}
const method = top ? 'scrollTop' : 'scrollLeft';
let result = 0;
if (isWindow(target)) {
result = target[top ? 'pageYOffset' : 'pageXOffset'];
result = target.pageYOffset;
} else if (target instanceof Document) {
result = target.documentElement[method];
result = target.documentElement.scrollTop;
} else if (target instanceof HTMLElement) {
result = target[method];
result = target.scrollTop;
} else if (target) {
// According to the type inference, the `target` is `never` type.
// Since we configured the loose mode type checking, and supports mocking the target with such shape below::
// `{ documentElement: { scrollLeft: 200, scrollTop: 400 } }`,
// the program may falls into this branch.
// Check the corresponding tests for details. Don't sure what is the real scenario this happens.
result = target[method];
// eslint-disable-next-line dot-notation
result = target['scrollTop'];
}
if (target && !isWindow(target) && typeof result !== 'number') {
result = (target.ownerDocument ?? target).documentElement?.[method];
result = (target.ownerDocument ?? target).documentElement?.scrollTop;
}
return result;
}
};
export default getScroll;

View File

@ -6,20 +6,20 @@ const BEAT_LIMIT = 1000 * 60 * 10;
* A helper class to map keys to values.
* It supports both primitive keys and object keys.
*/
class ArrayKeyMap {
map = new Map();
class ArrayKeyMap<T> {
map = new Map<string, T>();
// Use WeakMap to avoid memory leak
objectIDMap = new WeakMap();
objectIDMap = new WeakMap<object, number>();
nextID = 0;
lastAccessBeat = new Map();
lastAccessBeat = new Map<string, number>();
// We will clean up the cache when reach the limit
accessBeat = 0;
set(keys: any[], value: any) {
set(keys: React.DependencyList, value: any) {
// New set will trigger clear
this.clear();
@ -29,7 +29,7 @@ class ArrayKeyMap {
this.lastAccessBeat.set(compositeKey, Date.now());
}
get(keys: any[]) {
get(keys: React.DependencyList) {
const compositeKey = this.getCompositeKey(keys);
const cache = this.map.get(compositeKey);
@ -39,8 +39,8 @@ class ArrayKeyMap {
return cache;
}
getCompositeKey(keys: any[]) {
const ids = keys.map((key) => {
getCompositeKey(keys: React.DependencyList) {
const ids = keys.map<string>((key) => {
if (key && typeof key === 'object') {
return `obj_${this.getObjectID(key)}`;
}
@ -82,15 +82,16 @@ const uniqueMap = new ArrayKeyMap();
/**
* Like `useMemo`, but this hook result will be shared across all instances.
*/
export default function useUniqueMemo<T>(memoFn: () => T, deps: any[]): T {
return React.useMemo(() => {
function useUniqueMemo<T>(memoFn: () => T, deps: React.DependencyList) {
return React.useMemo<T>(() => {
const cachedValue = uniqueMap.get(deps);
if (cachedValue) {
return cachedValue;
return cachedValue as T;
}
const newValue = memoFn();
uniqueMap.set(deps, newValue);
return newValue;
}, deps);
}
export default useUniqueMemo;

View File

@ -15,7 +15,7 @@ interface ScrollToOptions {
export default function scrollTo(y: number, options: ScrollToOptions = {}) {
const { getContainer = () => window, callback, duration = 450 } = options;
const container = getContainer();
const scrollTop = getScroll(container, true);
const scrollTop = getScroll(container);
const startTime = Date.now();
const frameFunc = () => {

View File

@ -21,7 +21,7 @@ export interface WaveEffectProps {
const WaveEffect: React.FC<WaveEffectProps> = (props) => {
const { className, target, component } = props;
const divRef = React.useRef<HTMLDivElement | null>(null);
const divRef = React.useRef<HTMLDivElement>(null);
const [color, setWaveColor] = React.useState<string | null>(null);
const [borderRadius, setBorderRadius] = React.useState<number[]>([]);
@ -129,7 +129,7 @@ const WaveEffect: React.FC<WaveEffectProps> = (props) => {
{({ className: motionClassName }, ref) => (
<div
ref={composeRef(divRef, ref)}
className={classNames(className, { 'wave-quick': isSmallComponent }, motionClassName)}
className={classNames(className, motionClassName, { 'wave-quick': isSmallComponent })}
style={waveStyle}
/>
)}
@ -141,7 +141,7 @@ const showWaveEffect: ShowWaveEffect = (target, info) => {
const { component } = info;
// Skip for unchecked checkbox
if (component === 'Checkbox' && !target.querySelector('input')?.checked) {
if (component === 'Checkbox' && !target.querySelector<HTMLInputElement>('input')?.checked) {
return;
}

View File

@ -1,6 +1,7 @@
import { defaultPrefixCls } from '../../config-provider';
import type { GlobalToken } from '../../theme';
export const TARGET_CLS = 'ant-wave-target';
export const TARGET_CLS = `${defaultPrefixCls}-wave-target`;
export type ShowWaveEffect = (
element: HTMLElement,

View File

@ -9,7 +9,7 @@ import { ConfigContext } from '../config-provider';
import useStyle from './style';
import { getFixedBottom, getFixedTop, getTargetRect } from './utils';
const TRIGGER_EVENTS = [
const TRIGGER_EVENTS: (keyof WindowEventMap)[] = [
'resize',
'scroll',
'touchstart',
@ -17,7 +17,7 @@ const TRIGGER_EVENTS = [
'touchend',
'pageshow',
'load',
] as const;
];
function getDefaultTarget() {
return typeof window !== 'undefined' ? window : null;

View File

@ -257,7 +257,7 @@ const Anchor: React.FC<AnchorProps> = (props) => {
}
const container = getCurrentContainer();
const scrollTop = getScroll(container, true);
const scrollTop = getScroll(container);
const eleOffsetTop = getOffsetTop(targetElement, container);
let y = scrollTop + eleOffsetTop;
y -= targetOffset !== undefined ? targetOffset : offsetTop || 0;

View File

@ -44,7 +44,7 @@ const BackTop: React.FC<BackTopProps> = (props) => {
const handleScroll = throttleByAnimationFrame(
(e: React.UIEvent<HTMLElement, UIEvent> | { target: any }) => {
const scrollTop = getScroll(e.target, true);
const scrollTop = getScroll(e.target);
setVisible(scrollTop >= visibilityHeight);
},
);

View File

@ -225,6 +225,7 @@ const genSharedBadgeStyle: GenerateStyle<BadgeToken> = (token) => {
overflow: 'visible',
color: token.colorInfo,
backgroundColor: token.colorInfo,
borderColor: 'currentcolor',
'&::after': {
position: 'absolute',

View File

@ -138,9 +138,7 @@ const InternalCheckbox: React.ForwardRefRenderFunction<CheckboxRef, CheckboxProp
hashId,
);
const checkboxClass = classNames(
{
[`${prefixCls}-indeterminate`]: indeterminate,
},
{ [`${prefixCls}-indeterminate`]: indeterminate },
TARGET_CLS,
hashId,
);

View File

@ -105,7 +105,10 @@ const Collapse = React.forwardRef<HTMLDivElement, CollapseProps>((props, ref) =>
typeof mergedExpandIcon === 'function' ? (
mergedExpandIcon(panelProps)
) : (
<RightOutlined rotate={panelProps.isActive ? 90 : undefined} />
<RightOutlined
rotate={panelProps.isActive ? 90 : undefined}
aria-label={panelProps.isActive ? 'expanded' : 'collapsed'}
/>
);
return cloneElement(icon, () => ({
className: classNames((icon as React.ReactElement)?.props?.className, `${prefixCls}-arrow`),

View File

@ -19,7 +19,7 @@ exports[`renders components/collapse/demo/accordion.tsx extend context correctly
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -59,7 +59,7 @@ exports[`renders components/collapse/demo/accordion.tsx extend context correctly
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -99,7 +99,7 @@ exports[`renders components/collapse/demo/accordion.tsx extend context correctly
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -148,7 +148,7 @@ exports[`renders components/collapse/demo/basic.tsx extend context correctly 1`]
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="expanded"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -202,7 +202,7 @@ exports[`renders components/collapse/demo/basic.tsx extend context correctly 1`]
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -242,7 +242,7 @@ exports[`renders components/collapse/demo/basic.tsx extend context correctly 1`]
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -291,7 +291,7 @@ exports[`renders components/collapse/demo/borderless.tsx extend context correctl
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="expanded"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -345,7 +345,7 @@ exports[`renders components/collapse/demo/borderless.tsx extend context correctl
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -385,7 +385,7 @@ exports[`renders components/collapse/demo/borderless.tsx extend context correctl
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -438,7 +438,7 @@ exports[`renders components/collapse/demo/collapsible.tsx extend context correct
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="expanded"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -498,7 +498,7 @@ exports[`renders components/collapse/demo/collapsible.tsx extend context correct
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="expanded"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -560,7 +560,7 @@ exports[`renders components/collapse/demo/collapsible.tsx extend context correct
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -611,7 +611,7 @@ exports[`renders components/collapse/demo/component-token.tsx extend context cor
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -651,7 +651,7 @@ exports[`renders components/collapse/demo/component-token.tsx extend context cor
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -691,7 +691,7 @@ exports[`renders components/collapse/demo/component-token.tsx extend context cor
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -888,7 +888,7 @@ Array [
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="expanded"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -966,7 +966,7 @@ Array [
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -1030,7 +1030,7 @@ Array [
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -1249,7 +1249,7 @@ exports[`renders components/collapse/demo/ghost.tsx extend context correctly 1`]
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="expanded"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -1303,7 +1303,7 @@ exports[`renders components/collapse/demo/ghost.tsx extend context correctly 1`]
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -1343,7 +1343,7 @@ exports[`renders components/collapse/demo/ghost.tsx extend context correctly 1`]
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -1392,7 +1392,7 @@ exports[`renders components/collapse/demo/mix.tsx extend context correctly 1`] =
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -1432,7 +1432,7 @@ exports[`renders components/collapse/demo/mix.tsx extend context correctly 1`] =
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -1472,7 +1472,7 @@ exports[`renders components/collapse/demo/mix.tsx extend context correctly 1`] =
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -1521,7 +1521,7 @@ exports[`renders components/collapse/demo/noarrow.tsx extend context correctly 1
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="expanded"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -1612,7 +1612,7 @@ Array [
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -1666,7 +1666,7 @@ Array [
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -1720,7 +1720,7 @@ Array [
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>

View File

@ -19,7 +19,7 @@ exports[`renders components/collapse/demo/accordion.tsx correctly 1`] = `
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -59,7 +59,7 @@ exports[`renders components/collapse/demo/accordion.tsx correctly 1`] = `
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -99,7 +99,7 @@ exports[`renders components/collapse/demo/accordion.tsx correctly 1`] = `
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -146,7 +146,7 @@ exports[`renders components/collapse/demo/basic.tsx correctly 1`] = `
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="expanded"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -200,7 +200,7 @@ exports[`renders components/collapse/demo/basic.tsx correctly 1`] = `
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -240,7 +240,7 @@ exports[`renders components/collapse/demo/basic.tsx correctly 1`] = `
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -287,7 +287,7 @@ exports[`renders components/collapse/demo/borderless.tsx correctly 1`] = `
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="expanded"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -341,7 +341,7 @@ exports[`renders components/collapse/demo/borderless.tsx correctly 1`] = `
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -381,7 +381,7 @@ exports[`renders components/collapse/demo/borderless.tsx correctly 1`] = `
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -432,7 +432,7 @@ exports[`renders components/collapse/demo/collapsible.tsx correctly 1`] = `
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="expanded"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -492,7 +492,7 @@ exports[`renders components/collapse/demo/collapsible.tsx correctly 1`] = `
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="expanded"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -554,7 +554,7 @@ exports[`renders components/collapse/demo/collapsible.tsx correctly 1`] = `
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -603,7 +603,7 @@ exports[`renders components/collapse/demo/component-token.tsx correctly 1`] = `
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -643,7 +643,7 @@ exports[`renders components/collapse/demo/component-token.tsx correctly 1`] = `
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -683,7 +683,7 @@ exports[`renders components/collapse/demo/component-token.tsx correctly 1`] = `
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -876,7 +876,7 @@ Array [
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="expanded"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -954,7 +954,7 @@ Array [
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -1018,7 +1018,7 @@ Array [
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -1154,7 +1154,7 @@ exports[`renders components/collapse/demo/ghost.tsx correctly 1`] = `
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="expanded"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -1208,7 +1208,7 @@ exports[`renders components/collapse/demo/ghost.tsx correctly 1`] = `
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -1248,7 +1248,7 @@ exports[`renders components/collapse/demo/ghost.tsx correctly 1`] = `
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -1295,7 +1295,7 @@ exports[`renders components/collapse/demo/mix.tsx correctly 1`] = `
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -1335,7 +1335,7 @@ exports[`renders components/collapse/demo/mix.tsx correctly 1`] = `
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -1375,7 +1375,7 @@ exports[`renders components/collapse/demo/mix.tsx correctly 1`] = `
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -1422,7 +1422,7 @@ exports[`renders components/collapse/demo/noarrow.tsx correctly 1`] = `
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="expanded"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -1511,7 +1511,7 @@ Array [
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -1565,7 +1565,7 @@ Array [
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -1619,7 +1619,7 @@ Array [
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>

View File

@ -18,7 +18,7 @@ exports[`Collapse Collapse.Panel usage 1`] = `
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -58,7 +58,7 @@ exports[`Collapse Collapse.Panel usage 1`] = `
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -105,7 +105,7 @@ exports[`Collapse could override default openMotion 1`] = `
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="expanded"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -162,7 +162,7 @@ exports[`Collapse should render extra node of panel 1`] = `
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -211,7 +211,7 @@ exports[`Collapse should render extra node of panel 1`] = `
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>

View File

@ -251,4 +251,28 @@ describe('Collapse', () => {
);
expect(container.firstChild).toMatchSnapshot();
});
it('Check expandIcon aria-label value', () => {
const { container, rerender } = render(
<Collapse activeKey="1">
<Collapse.Panel header="header" key="1" />
</Collapse>,
);
expect(container.querySelector('.ant-collapse-arrow')).toHaveAttribute(
'aria-label',
'expanded',
);
rerender(
<Collapse>
<Collapse.Panel header="header" key="1" />
</Collapse>,
);
expect(container.querySelector('.ant-collapse-arrow')).toHaveAttribute(
'aria-label',
'collapsed',
);
});
});

View File

@ -4366,7 +4366,7 @@ exports[`renders components/color-picker/demo/panel-render.tsx extend context co
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="expanded"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -4503,7 +4503,7 @@ exports[`renders components/color-picker/demo/panel-render.tsx extend context co
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="expanded"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -4640,7 +4640,7 @@ exports[`renders components/color-picker/demo/panel-render.tsx extend context co
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="expanded"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -4777,7 +4777,7 @@ exports[`renders components/color-picker/demo/panel-render.tsx extend context co
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="expanded"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -5665,7 +5665,7 @@ Array [
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="expanded"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -5802,7 +5802,7 @@ Array [
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="expanded"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -5939,7 +5939,7 @@ Array [
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="expanded"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>

View File

@ -12232,7 +12232,7 @@ exports[`ConfigProvider components Collapse configProvider 1`] = `
class="config-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right config-collapse-arrow"
role="img"
>
@ -12279,7 +12279,7 @@ exports[`ConfigProvider components Collapse configProvider componentDisabled 1`]
class="config-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right config-collapse-arrow"
role="img"
>
@ -12326,7 +12326,7 @@ exports[`ConfigProvider components Collapse configProvider componentSize large 1
class="config-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right config-collapse-arrow"
role="img"
>
@ -12373,7 +12373,7 @@ exports[`ConfigProvider components Collapse configProvider componentSize middle
class="config-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right config-collapse-arrow"
role="img"
>
@ -12420,7 +12420,7 @@ exports[`ConfigProvider components Collapse configProvider componentSize small 1
class="config-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right config-collapse-arrow"
role="img"
>
@ -12467,7 +12467,7 @@ exports[`ConfigProvider components Collapse normal 1`] = `
class="ant-collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
@ -12514,7 +12514,7 @@ exports[`ConfigProvider components Collapse prefixCls 1`] = `
class="prefix-Collapse-expand-icon"
>
<span
aria-label="right"
aria-label="collapsed"
class="anticon anticon-right prefix-Collapse-arrow"
role="img"
>

View File

@ -1,6 +1,6 @@
import React, { useState } from 'react';
import { SmileOutlined } from '@ant-design/icons';
import { Button, ConfigProvider, Select } from 'antd';
import { Button, Checkbox, ConfigProvider, Radio, Select } from 'antd';
// Ant Design site use `es` module for view
// but do not replace related lib `lib` with `es`
@ -10,13 +10,19 @@ const App: React.FC = () => {
const [prefixCls, setPrefixCls] = useState('light');
return (
<>
<Button style={{ marginBottom: '12px' }} type="primary" onClick={() => setPrefixCls('dark')}>
<Button
style={{ marginBottom: 12 }}
type="primary"
onClick={() => setPrefixCls(prefixCls === 'light' ? 'dark' : 'light')}
>
toggle prefixCls
</Button>
<br />
<ConfigProvider prefixCls={prefixCls} iconPrefixCls="bamboo">
<SmileOutlined />
<Select style={{ width: 120 }} />
<Radio>test</Radio>
<Checkbox>test</Checkbox>
</ConfigProvider>
</>
);

View File

@ -254,6 +254,9 @@ export const genPanelStyle = (token: SharedPickerToken): CSSObject => {
cursor: 'pointer',
transition: `color ${motionDurationMid}`,
fontSize: 'inherit',
display: 'inline-flex',
alignItems: 'center',
justifyContent: 'center',
},
'> button': {
@ -275,10 +278,9 @@ export const genPanelStyle = (token: SharedPickerToken): CSSObject => {
fontWeight: fontWeightStrong,
lineHeight: unit(textHeight),
button: {
'> button': {
color: 'inherit',
fontWeight: 'inherit',
verticalAlign: 'top',
'&:not(:first-child)': {
marginInlineStart: paddingXS,
@ -296,7 +298,6 @@ export const genPanelStyle = (token: SharedPickerToken): CSSObject => {
&-super-prev-icon,
&-super-next-icon`]: {
position: 'relative',
display: 'inline-block',
width: pickerControlIconSize,
height: pickerControlIconSize,
@ -304,7 +305,6 @@ export const genPanelStyle = (token: SharedPickerToken): CSSObject => {
position: 'absolute',
top: 0,
insetInlineStart: 0,
display: 'inline-block',
width: pickerControlIconSize,
height: pickerControlIconSize,
border: `0 solid currentcolor`,

View File

@ -1020,7 +1020,9 @@ exports[`renders components/empty/demo/customize.tsx extend context correctly 1`
<div
class="ant-empty-description"
>
<span>
<span
class="ant-typography"
>
Customize
<a
href="#API"

View File

@ -738,7 +738,9 @@ exports[`renders components/empty/demo/customize.tsx correctly 1`] = `
<div
class="ant-empty-description"
>
<span>
<span
class="ant-typography"
>
Customize
<a
href="#API"

View File

@ -1,14 +1,14 @@
import React from 'react';
import { Button, Empty } from 'antd';
import { Button, Empty, Typography } from 'antd';
const App: React.FC = () => (
<Empty
image="https://gw.alipayobjects.com/zos/antfincdn/ZHrcdLPrvN/empty.svg"
imageStyle={{ height: 60 }}
description={
<span>
<Typography.Text>
Customize <a href="#API">Description</a>
</span>
</Typography.Text>
}
>
<Button type="primary">Create Now</Button>

View File

@ -42,7 +42,7 @@ const genSharedEmptyStyle: GenerateStyle<EmptyToken> = (token): CSSObject => {
},
[`${componentCls}-description`]: {
color: token.colorText,
color: token.colorTextDescription,
},
// 原来 &-footer 没有父子结构现在为了外层承担我们的hashId改成父子结果

View File

@ -48,7 +48,7 @@ const BackTop = React.forwardRef<FloatButtonRef, BackTopProps>((props, ref) => {
const handleScroll = throttleByAnimationFrame(
(e: React.UIEvent<HTMLElement, UIEvent> | { target: any }) => {
const scrollTop = getScroll(e.target, true);
const scrollTop = getScroll(e.target);
setVisible(scrollTop >= visibilityHeight);
},
);

View File

@ -11,7 +11,7 @@ export default () => (
},
}}
>
<Space>
<Space wrap>
<InputNumber />
<ConfigProvider
@ -36,8 +36,28 @@ export default () => (
},
}}
>
<InputNumber size="large" />
<InputNumber size="large" prefix="$" />
<Space wrap>
<InputNumber size="large" />
<InputNumber size="large" prefix="$" />
</Space>
</ConfigProvider>
<ConfigProvider
theme={{
components: {
InputNumber: {
inputFontSize: 30,
inputFontSizeSM: 20,
inputFontSizeLG: 40,
},
},
}}
>
<Space wrap>
<InputNumber defaultValue={11111} size="small" />
<InputNumber defaultValue={11111} />
<InputNumber defaultValue={11111} size="large" />
</Space>
</ConfigProvider>
</Space>
</ConfigProvider>

View File

@ -49,7 +49,8 @@ const genInputNumberStyles: GenerateStyle<InputNumberToken> = (token: InputNumbe
lineWidth,
lineType,
borderRadius,
fontSizeLG,
inputFontSizeSM,
inputFontSizeLG,
controlHeightLG,
controlHeightSM,
colorError,
@ -122,7 +123,7 @@ const genInputNumberStyles: GenerateStyle<InputNumberToken> = (token: InputNumbe
'&-lg': {
padding: 0,
fontSize: fontSizeLG,
fontSize: inputFontSizeLG,
lineHeight: lineHeightLG,
borderRadius: borderRadiusLG,
@ -134,6 +135,7 @@ const genInputNumberStyles: GenerateStyle<InputNumberToken> = (token: InputNumbe
'&-sm': {
padding: 0,
fontSize: inputFontSizeSM,
borderRadius: borderRadiusSM,
[`input${componentCls}-input`]: {

View File

@ -5,18 +5,35 @@ import Calendar from '../calendar/locale/mn_MN';
import DatePicker from '../date-picker/locale/mn_MN';
import TimePicker from '../time-picker/locale/mn_MN';
const typeTemplate = '${label} нь хүчинтэй ${type} биш';
const localeValues: Locale = {
locale: 'mn-mn',
Pagination,
DatePicker,
TimePicker,
Calendar,
global:{
placeholder: 'Сонгоно уу',
},
Table: {
filterTitle: 'Хайх цэс',
filterConfirm: 'Тийм',
filterReset: 'Цэвэрлэх',
filterEmptyText: 'Шүүлтүүр байхгүй',
filterCheckall: 'Бүх зүйлийг сонгоно уу',
filterSearchPlaceholder: 'Шүүлтүүрээс хайх',
emptyText: 'Өгөгдөл алга',
selectAll: 'Бүгдийг сонгох',
selectInvert: 'Бусдыг сонгох',
selectNone: 'Бүх өгөгдлийг арилгах',
selectionAll: 'Бүх өгөгдлийг сонгоно уу',
sortTitle: 'Эрэмбэлэх',
expand: 'Мөрийг өргөжүүлэх',
collapse: 'Мөрийг буулгах',
triggerDesc: 'Буурах байдлаар эрэмбэлэхийн тулд товшино уу',
triggerAsc: 'Өсөхөөр эрэмбэлэхийн тулд товшино уу',
cancelSort: 'Эрэмбэлэхийг цуцлахын тулд товшино уу',
},
Modal: {
okText: 'Тийм',
@ -32,6 +49,12 @@ const localeValues: Locale = {
searchPlaceholder: 'Хайх',
itemUnit: 'Зүйл',
itemsUnit: 'Зүйлүүд',
remove: 'Устгах',
selectCurrent: 'Одоогийн хуудсыг сонгоно уу',
removeCurrent: 'Одоогийн хуудсыг устгана уу',
selectAll: 'Бүх өгөгдлийг сонгоно уу',
removeAll: 'Бүх өгөгдлийг устгана уу',
selectInvert: 'Одоогийн хуудсыг эргүүлэх',
},
Upload: {
uploading: 'Хуулж байна...',
@ -43,6 +66,68 @@ const localeValues: Locale = {
Empty: {
description: 'Мэдээлэл байхгүй байна',
},
Icon: {
icon: 'дүрс',
},
Text: {
edit: 'Засварлах',
copy: 'Хуулбарлах',
copied: 'Хуулсан',
expand: 'Өргөтгөх',
},
Form: {
optional: '(сонголттой)',
defaultValidateMessages: {
default: '${label}-ийн талбарын баталгаажуулалтын алдаа',
required: '${label} оруулна уу',
enum: '${label} нь [${enum}]-ийн нэг байх ёстой',
whitespace: '${label} нь хоосон тэмдэгт байж болохгүй',
date: {
format: '${label} огнооны формат буруу байна',
parse: '${label}-г огноо руу хөрвүүлэх боломжгүй',
invalid: '${label} нь хүчингүй огноо юм',
},
types: {
string: typeTemplate,
method: typeTemplate,
array: typeTemplate,
object: typeTemplate,
number: typeTemplate,
date: typeTemplate,
boolean: typeTemplate,
integer: typeTemplate,
float: typeTemplate,
regexp: typeTemplate,
email: typeTemplate,
url: typeTemplate,
hex: typeTemplate,
},
string: {
len: '${label} ${len} тэмдэгттэй байх ёстой',
min: '${label} хамгийн багадаа ${min} тэмдэгттэй байх ёстой',
max: '${label} нь ${max} хүртэлх тэмдэгттэй байх ёстой',
range: '${label} ${min}-${max} тэмдэгтийн хооронд байх ёстой',
},
number: {
len: '${label} нь ${len}-тэй тэнцүү байх ёстой',
min: '${label} хамгийн багадаа ${min} байх ёстой',
max: '${label} дээд тал нь ${max} байх ёстой',
range: '${label} ${min}-${max} хооронд байх ёстой',
},
array: {
len: '${len} ${label} байх ёстой',
min: 'Дор хаяж ${мин} ${label}',
max: 'Хамгийн ихдээ ${max} ${label}',
range: '${label}-н хэмжээ ${min}-${max} хооронд байх ёстой',
},
pattern: {
mismatch: '${label} нь ${pattern} загвартай тохирохгүй байна',
},
},
},
Image: {
preview: 'Урьдчилан үзэх',
},
};
export default localeValues;

View File

@ -94,7 +94,7 @@ const InternalRadio: React.ForwardRefRenderFunction<RadioRef, RadioProps> = (pro
{/* @ts-ignore */}
<RcCheckbox
{...radioProps}
className={classNames(radioProps.className, !isButtonType && TARGET_CLS)}
className={classNames(radioProps.className, { [TARGET_CLS]: !isButtonType })}
type="radio"
prefixCls={prefixCls}
ref={mergedRef}

View File

@ -10420,7 +10420,7 @@ exports[`renders components/select/demo/responsive.tsx extend context correctly
</span>
<div
class="ant-tooltip ant-zoom-big-fast-appear ant-zoom-big-fast-appear-prepare ant-zoom-big-fast ant-tooltip-placement-top"
style="--arrow-x: 0px; --arrow-y: 0px; left: -1000vw; top: -1000vh; box-sizing: border-box;"
style="--arrow-x: 0px; --arrow-y: 0px; left: -1000vw; top: -1000vh; box-sizing: border-box; pointer-events: none;"
>
<div
class="ant-tooltip-arrow"

View File

@ -1,7 +1,7 @@
## zh-CN
使用 `optionRender` 自定义回填到选择框的内容
使用 `optionRender` 自定义渲染下拉选项
## en-US
Use `optionRender` to customize the content to be backfilled into the selection box.
Use `optionRender` to customize the rendering dropdown options

View File

@ -41,7 +41,10 @@ const App: React.FC = () => {
{...sharedProps}
{...selectProps}
maxTagPlaceholder={(omittedValues) => (
<Tooltip title={omittedValues.map(({ label }) => label).join(', ')}>
<Tooltip
overlayStyle={{ pointerEvents: 'none' }}
title={omittedValues.map(({ label }) => label).join(', ')}
>
<span>Hover Me</span>
</Tooltip>
)}

View File

@ -42,7 +42,7 @@ return (
<code src="./demo/search.tsx">Select with search field</code>
<code src="./demo/multiple.tsx">multiple selection</code>
<code src="./demo/size.tsx">Sizes</code>
<code src="./demo/option-render.tsx">Custom selection render</code>
<code src="./demo/option-render.tsx">Custom dropdown options</code>
<code src="./demo/search-sort.tsx">Search with sort</code>
<code src="./demo/tags.tsx">Tags</code>
<code src="./demo/optgroup.tsx">Option Group</code>

View File

@ -43,7 +43,7 @@ return (
<code src="./demo/search.tsx">带搜索框</code>
<code src="./demo/multiple.tsx">多选</code>
<code src="./demo/size.tsx">三种大小</code>
<code src="./demo/option-render.tsx">定制回填内容</code>
<code src="./demo/option-render.tsx">自定义下拉选项</code>
<code src="./demo/search-sort.tsx">带排序的搜索</code>
<code src="./demo/tags.tsx">标签</code>
<code src="./demo/optgroup.tsx">分组</code>

View File

@ -47,7 +47,7 @@ Common props ref[Common props](/docs/react/common-props)
| min | The minimum value the slider can slide to | number | 0 | |
| range | Dual thumb mode | boolean | false | |
| reverse | Reverse the component | boolean | false | |
| step | The granularity the slider can step through values. Must greater than 0, and be divided by (max - min) . When `marks` no null, `step` can be null | number \| null | 1 | |
| step | The granularity the slider can step through values. Must greater than 0, and be divided by (max - min) . When `step` is `null` but exist `marks`, the valid point will only be the `mark`, `min` and `max` | number \| null | 1 | |
| styles | Semantic structure style | [Record<SemanticDOM, React.CSSProperties>](#semantic-dom) | - | 5.10.0 |
| tooltip | The tooltip relate props | [tooltip](#tooltip) | - | 4.23.0 |
| value | The value of slider. When `range` is false, use number, otherwise, use \[number, number] | number \| \[number, number] | - | |

View File

@ -48,7 +48,7 @@ demo:
| min | 最小值 | number | 0 | |
| range | 双滑块模式 | boolean \| [range](#range) | false | |
| reverse | 反向坐标轴 | boolean | false | |
| step | 步长,取值必须大于 0并且可被 (max - min) 整除。当 `marks` 不为空对象时,可以设置 `step` 为 null此时 Slider 的可选值仅有 marks 标出来的部分 | number \| null | 1 | |
| step | 步长,取值必须大于 0并且可被 (max - min) 整除。当 `marks` 不为空对象时,可以设置 `step` 为 null此时 Slider 的可选值仅有 `marks`、`min` 和 `max` | number \| null | 1 | |
| styles | 语义化结构 styles | [Record<SemanticDOM, React.CSSProperties>](#semantic-dom) | - | 5.10.0 |
| tooltip | 设置 Tooltip 相关属性 | [tooltip](#tooltip) | - | 4.23.0 |
| value | 设置当前取值。当 `range` 为 false 时,使用 number否则用 \[number, number] | number \| \[number, number] | - | |

View File

@ -0,0 +1,158 @@
import React, { useState } from 'react';
import Table from '..';
import { render, fireEvent } from '../../../tests/utils';
describe('Sorter.value.test.tsx', () => {
const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
afterEach(() => {
errorSpy.mockReset();
});
afterAll(() => {
errorSpy.mockRestore();
});
interface stateType {
columns: Array<{
title: string;
dataIndex: string;
sorter: {
multiple: number;
};
}>;
data: Array<{
key: React.Key;
age?: number;
foo?: string;
name?: string;
}>;
}
const data = {
columns: [
{
title: 'Age',
dataIndex: 'age',
sorter: {
multiple: 2,
},
},
{
title: 'foo',
dataIndex: 'foo',
sorter: {
multiple: 2,
},
},
],
data: [
{
key: '1',
age: 32,
foo: 'foo',
},
{
key: '2',
age: 33,
foo: 'bar',
},
],
};
it('should call onChange with correct sorter value when clicked', () => {
const onChange = jest.fn();
const { container } = render(
<Table
columns={data.columns}
dataSource={data.data}
onChange={onChange}
showSorterTooltip={{ target: 'sorter-icon' }}
/>,
);
fireEvent.click(container.querySelector('.ant-table-column-sorters')!);
const sorter1 = onChange.mock.calls[0][2];
expect(sorter1.order).toBe('ascend');
expect(sorter1.field).toBe('age');
const columnSorters = container.querySelectorAll('.ant-table-column-sorters');
const fooSorterIcon = columnSorters[1];
fireEvent.click(fooSorterIcon);
const sorter2 = onChange.mock.calls[1][2];
expect(sorter2.length).toBe(2);
expect(sorter2[0].order).toBe('ascend');
expect(sorter2[0].field).toBe('age');
expect(sorter2[1].order).toBe('ascend');
expect(sorter2[1].field).toBe('foo');
});
it('onChange should be called with the correct sorter value when clicked when the column changes', () => {
const onChange = jest.fn();
const TableSorter: React.FC = () => {
const [tableData, setTableData] = useState<stateType>(data);
const handleClick = () => {
setTableData({
columns: [
{
title: 'name',
dataIndex: 'name',
sorter: {
multiple: 2,
},
},
{
title: 'foo',
dataIndex: 'foo',
sorter: {
multiple: 2,
},
},
],
data: [
{
key: 'sxzz',
name: 'sxzz',
foo: 'foo',
},
{
key: 'innei',
name: 'innei',
foo: 'bar',
},
],
});
};
return (
<>
<Table
columns={tableData.columns}
dataSource={tableData.data}
onChange={onChange}
showSorterTooltip={{ target: 'sorter-icon' }}
/>
<button className="change-column" type="button" onClick={handleClick}>
change11
</button>
</>
);
};
const { container } = render(<TableSorter />);
fireEvent.click(container.querySelector('.ant-table-column-sorters')!);
const sorter1 = onChange.mock.calls[0][2];
expect(sorter1.order).toBe('ascend');
expect(sorter1.field).toBe('age');
const changeButton = container.querySelector('.change-column');
fireEvent.click(changeButton!);
const columnSorters = container.querySelectorAll('.ant-table-column-sorters');
const fooSorterIcon = columnSorters[1];
fireEvent.click(fooSorterIcon);
const sorter2 = onChange.mock.calls[1][2];
expect(sorter2.order).toBe('ascend');
expect(sorter2.field).toBe('foo');
});
});

View File

@ -401,7 +401,7 @@ export default function useFilterSorter<RecordType>({
// Return if not controlled
if (!collectedStates.length) {
return sortStates;
return sortStates.filter(item => mergedColumns.includes(item.column));
}
const validateStates: SortState<RecordType>[] = [];

View File

@ -69,6 +69,7 @@ Common props ref[Common props](/docs/react/common-props)
| treeCheckStrictly | Whether to check nodes precisely (in the `checkable` mode), means parent and child nodes are not associated, and it will make `labelInValue` be true | boolean | false | |
| treeData | Data of the treeNodes, manual construction work is no longer needed if this property has been set(ensure the Uniqueness of each value) | array&lt;{ value, title, children, \[disabled, disableCheckbox, selectable, checkable] }> | \[] | |
| treeDataSimpleMode | Enable simple mode of treeData. Changes the `treeData` schema to: \[{id:1, pId:0, value:'1', title:"test1",...},...] where pId is parent node's id). It is possible to replace the default `id` and `pId` keys by providing object to `treeDataSimpleMode` | boolean \| object&lt;{ id: string, pId: string, rootPId: string }> | false | |
| treeTitleRender | Customize tree node title render | (nodeData) => ReactNode | - | 5.12.0 |
| treeDefaultExpandAll | Whether to expand all treeNodes by default | boolean | false | |
| treeDefaultExpandedKeys | Default expanded treeNodes | string\[] | - | |
| treeExpandAction | Tree title open logic when click, optional: false \| `click` \| `doubleClick` | string \| boolean | false | 4.21.0 |

View File

@ -70,6 +70,7 @@ demo:
| treeCheckStrictly | `checkable` 状态下节点选择完全受控(父子节点选中状态不再关联),会使得 `labelInValue` 强制为 true | boolean | false | |
| treeData | treeNodes 数据,如果设置则不需要手动构造 TreeNode 节点value 在整个树范围内唯一) | array&lt;{value, title, children, \[disabled, disableCheckbox, selectable, checkable]}> | \[] | |
| treeDataSimpleMode | 使用简单格式的 treeData具体设置参考可设置的类型 (此时 treeData 应变为这样的数据结构: \[{id:1, pId:0, value:'1', title:"test1",...},...] `pId` 是父节点的 id) | boolean \| object&lt;{ id: string, pId: string, rootPId: string }> | false | |
| treeTitleRender | 自定义渲染节点 | (nodeData) => ReactNode | - | 5.12.0 |
| treeDefaultExpandAll | 默认展开所有树节点 | boolean | false | |
| treeDefaultExpandedKeys | 默认展开的树节点 | string\[] | - | |
| treeExpandAction | 点击节点 title 时的展开逻辑可选false \| `click` \| `doubleClick` | string \| boolean | false | 4.21.0 |

View File

@ -5,7 +5,7 @@ order: 2
title: Usage with Vite
---
[Vite](https://vitejs.dev/) is one of the best React application development tools. We are going to use `antd` within it and modify the vite config for some customized needs.
[Vite](https://vitejs.dev/) is one of the best React application development tools. Let's use `antd` within it.
## Install and Initialization

6
mako.config.json Normal file
View File

@ -0,0 +1,6 @@
{
"optimization": {
"skipModules": false,
"concatenateModules": false
}
}

View File

@ -1,6 +1,6 @@
{
"name": "antd",
"version": "5.18.0",
"version": "5.18.1",
"description": "An enterprise-class UI design language and React components implementation",
"keywords": [
"ant",
@ -117,10 +117,10 @@
],
"dependencies": {
"@ant-design/colors": "^7.0.2",
"@ant-design/cssinjs": "^1.19.1",
"@ant-design/cssinjs": "^1.20.0",
"@ant-design/icons": "^5.3.7",
"@ant-design/react-slick": "~1.1.2",
"@babel/runtime": "^7.24.5",
"@babel/runtime": "^7.24.7",
"@ctrl/tinycolor": "^3.6.1",
"@rc-component/color-picker": "~1.5.3",
"@rc-component/mutate-observer": "^1.1.0",
@ -128,7 +128,7 @@
"@rc-component/trigger": "^2.2.0",
"classnames": "^2.5.1",
"copy-to-clipboard": "^3.3.3",
"dayjs": "^1.11.10",
"dayjs": "^1.11.11",
"qrcode.react": "^3.1.0",
"rc-cascader": "~3.26.0",
"rc-checkbox": "~3.3.0",
@ -155,24 +155,24 @@
"rc-steps": "~6.0.1",
"rc-switch": "~4.1.0",
"rc-table": "~7.45.7",
"rc-tabs": "~15.1.0",
"rc-tabs": "~15.1.1",
"rc-textarea": "~1.7.0",
"rc-tooltip": "~6.2.0",
"rc-tree": "~5.8.7",
"rc-tree": "~5.8.8",
"rc-tree-select": "~5.21.0",
"rc-upload": "~4.5.2",
"rc-util": "^5.41.0",
"rc-util": "^5.42.1",
"scroll-into-view-if-needed": "^3.1.0",
"throttle-debounce": "^5.0.0"
},
"devDependencies": {
"@ant-design/compatible": "^5.1.2",
"@ant-design/compatible": "^5.1.3",
"@ant-design/happy-work-theme": "^1.0.0",
"@ant-design/tools": "^18.0.2",
"@antv/g6": "^4.8.24",
"@babel/eslint-plugin": "^7.24.5",
"@biomejs/biome": "^1.7.2",
"@codesandbox/sandpack-react": "^2.13.10",
"@babel/eslint-plugin": "^7.24.7",
"@biomejs/biome": "^1.8.1",
"@codesandbox/sandpack-react": "^2.14.2",
"@dnd-kit/core": "^6.1.0",
"@dnd-kit/modifiers": "^7.0.0",
"@dnd-kit/sortable": "^8.0.0",
@ -183,12 +183,12 @@
"@madccc/duplicate-package-checker-webpack-plugin": "^1.0.0",
"@microflash/rehype-figure": "^2.1.0",
"@npmcli/run-script": "^8.1.0",
"@octokit/rest": "^20.1.0",
"@qixian.cs/github-contributors-list": "^2.0.1",
"@size-limit/file": "^11.1.2",
"@stackblitz/sdk": "^1.9.0",
"@octokit/rest": "^20.1.1",
"@qixian.cs/github-contributors-list": "^2.0.2",
"@size-limit/file": "^11.1.4",
"@stackblitz/sdk": "^1.10.0",
"@testing-library/dom": "^10.1.0",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/jest-dom": "^6.4.6",
"@testing-library/react": "^16.0.0",
"@testing-library/user-event": "^14.5.2",
"@types/adm-zip": "^0.5.5",
@ -203,19 +203,19 @@
"@types/jest-axe": "^3.5.9",
"@types/jest-environment-puppeteer": "^5.0.6",
"@types/jest-image-snapshot": "^6.4.0",
"@types/jquery": "^3.5.29",
"@types/jsdom": "^21.1.6",
"@types/lodash": "^4.17.0",
"@types/jquery": "^3.5.30",
"@types/jsdom": "^21.1.7",
"@types/lodash": "^4.17.5",
"@types/minimist": "^1.2.5",
"@types/node": "^20.12.7",
"@types/node": "^20.14.2",
"@types/nprogress": "^0.2.3",
"@types/ora": "^3.2.0",
"@types/pixelmatch": "^5.2.6",
"@types/pngjs": "^6.0.4",
"@types/prismjs": "^1.26.3",
"@types/pngjs": "^6.0.5",
"@types/prismjs": "^1.26.4",
"@types/progress": "^2.0.7",
"@types/qs": "^6.9.15",
"@types/react": "^18.3.1",
"@types/react": "^18.3.3",
"@types/react-copy-to-clipboard": "^5.0.7",
"@types/react-dom": "^18.3.0",
"@types/react-highlight-words": "^0.20.0",
@ -225,14 +225,14 @@
"@types/tar": "^6.1.13",
"@types/throttle-debounce": "^5.0.2",
"@types/warning": "^3.0.3",
"@typescript-eslint/eslint-plugin": "^7.8.0",
"@typescript-eslint/parser": "^7.8.0",
"adm-zip": "^0.5.12",
"@typescript-eslint/eslint-plugin": "^7.13.0",
"@typescript-eslint/parser": "^7.13.0",
"adm-zip": "^0.5.14",
"ali-oss": "^6.20.0",
"antd-img-crop": "^4.21.0",
"antd-img-crop": "^4.22.0",
"antd-style": "^3.6.2",
"antd-token-previewer": "^2.0.8",
"axios": "^1.6.8",
"axios": "^1.7.2",
"chalk": "^4.1.2",
"cheerio": "1.0.0-rc.12",
"circular-dependency-plugin": "^5.2.2",
@ -241,7 +241,7 @@
"cross-fetch": "^4.0.0",
"crypto": "^1.0.1",
"dekko": "^0.2.1",
"dumi": "^2.3.2",
"dumi": "2.4.0-alpha.16",
"dumi-plugin-color-chunk": "^1.1.0",
"esbuild-loader": "^4.1.0",
"eslint": "^8.57.0",
@ -250,24 +250,24 @@
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-compat": "^4.2.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jest": "^28.3.0",
"eslint-plugin-jest": "^28.6.0",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-lodash": "^7.4.0",
"eslint-plugin-markdown": "^5.0.0",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react": "^7.34.2",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-unicorn": "^53.0.0",
"fast-glob": "^3.3.2",
"fetch-jsonp": "^1.3.0",
"fs-extra": "^11.2.0",
"gh-pages": "^6.1.1",
"glob": "^10.3.12",
"glob": "^10.4.1",
"html2sketch": "^1.0.2",
"http-server": "^14.1.1",
"husky": "^9.0.11",
"identity-obj-proxy": "^3.0.0",
"immer": "^10.1.1",
"inquirer": "^9.2.20",
"inquirer": "^9.2.23",
"is-ci": "^3.0.1",
"isomorphic-fetch": "^3.0.0",
"jest": "^29.7.0",
@ -278,10 +278,10 @@
"jest-image-snapshot": "^6.4.0",
"jest-puppeteer": "^10.0.1",
"jquery": "^3.7.1",
"jsdom": "^24.0.0",
"jsdom": "^24.1.0",
"jsonml-to-react-element": "^1.1.11",
"jsonml.js": "^0.1.0",
"lint-staged": "^15.2.2",
"lint-staged": "^15.2.7",
"lodash": "^4.17.21",
"lunar-typescript": "^1.7.5",
"lz-string": "^1.5.0",
@ -294,15 +294,15 @@
"ora": "^8.0.1",
"pixelmatch": "^5.3.0",
"pngjs": "^7.0.0",
"prettier": "^3.2.5",
"prettier": "^3.3.2",
"prettier-plugin-jsdoc": "^1.3.0",
"pretty-format": "^29.7.0",
"prismjs": "^1.29.0",
"puppeteer": "^22.7.1",
"puppeteer": "^22.11.0",
"qs": "^6.12.1",
"rc-footer": "^0.6.8",
"rc-tween-one": "^3.0.6",
"rc-virtual-list": "^3.11.5",
"rc-virtual-list": "^3.14.3",
"react": "^18.3.1",
"react-copy-to-clipboard": "^5.1.0",
"react-countup": "^6.5.3",
@ -311,9 +311,9 @@
"react-fast-marquee": "^1.6.4",
"react-highlight-words": "^0.20.0",
"react-infinite-scroll-component": "^6.1.0",
"react-intersection-observer": "^9.10.1",
"react-intersection-observer": "^9.10.3",
"react-resizable": "^3.0.5",
"react-router-dom": "^6.23.0",
"react-router-dom": "^6.23.1",
"react-sticky-box": "^2.0.5",
"regenerator-runtime": "^0.14.1",
"rehype-stringify": "^10.0.0",
@ -325,25 +325,25 @@
"remark-preset-lint-recommended": "^7.0.0",
"remark-rehype": "^11.1.0",
"runes2": "^1.1.4",
"semver": "^7.6.0",
"sharp": "^0.33.3",
"simple-git": "^3.24.0",
"size-limit": "^11.1.2",
"semver": "^7.6.2",
"sharp": "^0.33.4",
"simple-git": "^3.25.0",
"size-limit": "^11.1.4",
"spinnies": "^0.5.1",
"stylelint": "^16.4.0",
"stylelint": "^16.6.1",
"stylelint-config-rational-order": "^0.1.2",
"stylelint-config-standard": "^36.0.0",
"stylelint-prettier": "^5.0.0",
"sylvanas": "^0.6.1",
"tar": "^7.0.1",
"tar": "^7.2.0",
"tar-fs": "^3.0.6",
"terser": "^5.31.0",
"tsx": "^4.15.1",
"terser": "^5.31.1",
"tsx": "4.11.2",
"typedoc": "^0.25.13",
"typescript": "~5.4.5",
"vanilla-jsoneditor": "^0.23.2",
"vanilla-jsoneditor": "^0.23.7",
"vanilla-tilt": "^1.8.1",
"webpack": "^5.91.0",
"webpack": "^5.92.0",
"webpack-bundle-analyzer": "^4.10.2",
"xhr-mock": "^2.5.1"
},
@ -354,6 +354,11 @@
"publishConfig": {
"registry": "https://registry.npmjs.org/"
},
"overrides": {
"dumi-plugin-color-chunk": {
"dumi": "^2.4.0-alpha.16"
}
},
"size-limit": [
{
"path": "./dist/antd.min.js",