docs: fix typos (#40791)

* docs: fix typos

* Update index.zh-CN.md

* test: update snapshot

* docs: fix demo ref

* chore: force trigger ci

* chore: force trigger ci

* chore: bump dumi ver

---------

Co-authored-by: Amumu <yoyo837@hotmail.com>
Co-authored-by: 二货机器人 <smith3816@gmail.com>
This commit is contained in:
Lioness100 2023-02-23 08:56:43 -05:00 committed by GitHub
parent 6b552d53f6
commit fd0d8b6031
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
65 changed files with 161 additions and 162 deletions

View File

@ -43,7 +43,7 @@ function getOffsetTop(element: HTMLElement, container: AnchorContainer): number
return rect.top; return rect.top;
} }
const sharpMatcherRegx = /#([\S ]+)$/; const sharpMatcherRegex = /#([\S ]+)$/;
interface Section { interface Section {
link: string; link: string;
@ -196,7 +196,7 @@ const AnchorContent: React.FC<InternalAnchorProps> = (props) => {
const linkSections: Section[] = []; const linkSections: Section[] = [];
const container = getCurrentContainer(); const container = getCurrentContainer();
_links.forEach((link) => { _links.forEach((link) => {
const sharpLinkMatch = sharpMatcherRegx.exec(link?.toString()); const sharpLinkMatch = sharpMatcherRegex.exec(link?.toString());
if (!sharpLinkMatch) { if (!sharpLinkMatch) {
return; return;
} }
@ -251,7 +251,7 @@ const AnchorContent: React.FC<InternalAnchorProps> = (props) => {
setCurrentActiveLink(link); setCurrentActiveLink(link);
const container = getCurrentContainer(); const container = getCurrentContainer();
const scrollTop = getScroll(container, true); const scrollTop = getScroll(container, true);
const sharpLinkMatch = sharpMatcherRegx.exec(link); const sharpLinkMatch = sharpMatcherRegex.exec(link);
if (!sharpLinkMatch) { if (!sharpLinkMatch) {
return; return;
} }

View File

@ -374,10 +374,10 @@ describe('Anchor Render', () => {
it('handles invalid hash correctly', () => { it('handles invalid hash correctly', () => {
const { container } = render( const { container } = render(
<Anchor items={[{ key: 'title', href: 'notexsited', title: 'title' }]} />, <Anchor items={[{ key: 'title', href: 'nonexistent', title: 'title' }]} />,
); );
const link = container.querySelector(`a[href="notexsited"]`)!; const link = container.querySelector(`a[href="nonexistent"]`)!;
fireEvent.click(link); fireEvent.click(link);
expect(container.querySelector(`.ant-anchor-link-title-active`)?.textContent).toBe('title'); expect(container.querySelector(`.ant-anchor-link-title-active`)?.textContent).toBe('title');
}); });
@ -791,11 +791,11 @@ describe('Anchor Render', () => {
it('handles invalid hash correctly', () => { it('handles invalid hash correctly', () => {
const { container } = render( const { container } = render(
<Anchor> <Anchor>
<Link href="notexsited" title="title" /> <Link href="nonexistent" title="title" />
</Anchor>, </Anchor>,
); );
const link = container.querySelector(`a[href="notexsited"]`)!; const link = container.querySelector(`a[href="nonexistent"]`)!;
fireEvent.click(link); fireEvent.click(link);
expect(container.querySelector(`.ant-anchor-link-title-active`)?.textContent).toBe('title'); expect(container.querySelector(`.ant-anchor-link-title-active`)?.textContent).toBe('title');
}); });

View File

@ -56,7 +56,7 @@ describe('AutoComplete children could be focus', () => {
expect(mockRef).toHaveBeenCalled(); expect(mockRef).toHaveBeenCalled();
}); });
it('child.ref instance should support be focused and blured', () => { it('child.ref instance should support be focused and blurred', () => {
const inputRef = React.createRef<HTMLInputElement>(); const inputRef = React.createRef<HTMLInputElement>();
render( render(
<AutoComplete dataSource={[]}> <AutoComplete dataSource={[]}>

View File

@ -68,7 +68,7 @@ describe('AutoComplete', () => {
expect(screen.getByTitle(/reactnode/i)).toBeInTheDocument(); expect(screen.getByTitle(/reactnode/i)).toBeInTheDocument();
}); });
it('legacy AutoComplete.Option should be compatiable', async () => { it('legacy AutoComplete.Option should be compatible', async () => {
render( render(
<AutoComplete> <AutoComplete>
<AutoComplete.Option value="111">111</AutoComplete.Option> <AutoComplete.Option value="111">111</AutoComplete.Option>

View File

@ -8,4 +8,4 @@
You can customize the style of the button, just note the size limit: no more than `40px * 40px`. You can customize the style of the button, just note the size limit: no more than `40px * 40px`.
> Note: `BackTop` expects a element could accept `onClick` propety as children. If you put a text directly as children the component will not function properly. > Note: `BackTop` expects a element could accept `onClick` property as children. If you put a text directly as children the component will not function properly.

View File

@ -65,7 +65,7 @@ describe('Badge', () => {
expect(container.querySelectorAll('.ant-badge-dot').length).toBe(0); expect(container.querySelectorAll('.ant-badge-dot').length).toBe(0);
}); });
it('should have an overriden title attribute', () => { it('should have an overridden title attribute', () => {
const { container } = render(<Badge count={10} title="Custom title" />); const { container } = render(<Badge count={10} title="Custom title" />);
expect((container.querySelector('.ant-scroll-number')! as HTMLElement).title).toEqual( expect((container.querySelector('.ant-scroll-number')! as HTMLElement).title).toEqual(
'Custom title', 'Custom title',

View File

@ -1,7 +1,7 @@
## zh-CN ## zh-CN
测试 `count` `stauts` `color` `dot` 共用的情况。 测试 `count` `status` `color` `dot` 共用的情况。
## en-US ## en-US
Using `count/dot` with custom `stauts/color`. Using `count/dot` with custom `status/color`.

View File

@ -128,7 +128,7 @@ describe('Carousel', () => {
}); });
describe('dots precise control by plain object', () => { describe('dots precise control by plain object', () => {
it('use dots to provide dotsClasse', () => { it('use dots to provide dotsClass', () => {
const { container } = render( const { container } = render(
<Carousel dots={{ className: 'customDots' }}> <Carousel dots={{ className: 'customDots' }}>
<div>1</div> <div>1</div>

View File

@ -61,7 +61,7 @@ function highlightKeyword(str: string, lowerKeyword: string, prefixCls?: string)
if (index % 2 === 1) { if (index % 2 === 1) {
originWorld = ( originWorld = (
// eslint-disable-next-line react/no-array-index-key // eslint-disable-next-line react/no-array-index-key
<span className={`${prefixCls}-menu-item-keyword`} key={`seperator-${index}`}> <span className={`${prefixCls}-menu-item-keyword`} key={`separator-${index}`}>
{originWorld} {originWorld}
</span> </span>
); );

View File

@ -178,7 +178,7 @@ describe('ConfigProvider.Theme', () => {
expect(tokens.a).toMatchObject(tokens.b); expect(tokens.a).toMatchObject(tokens.b);
}); });
it('theme seperated should work', () => { it('theme separated should work', () => {
let tokenRef: any; let tokenRef: any;
const Demo = () => { const Demo = () => {
const [, token] = useToken(); const [, token] = useToken();

View File

@ -88,7 +88,7 @@ describe('RangePicker', () => {
}); });
describe('ranges', () => { describe('ranges', () => {
it('RangePicker support presetted ranges with Tags', () => { it('RangePicker support preset ranges with Tags', () => {
const { container } = render( const { container } = render(
<RangePicker <RangePicker
open open

View File

@ -61,7 +61,7 @@ exports[`RangePicker customize separator 1`] = `
</div> </div>
`; `;
exports[`RangePicker ranges RangePicker support presetted ranges with Tags 1`] = ` exports[`RangePicker ranges RangePicker support preset ranges with Tags 1`] = `
Array [ Array [
<div <div
class="ant-picker ant-picker-range" class="ant-picker ant-picker-range"

View File

@ -30650,7 +30650,7 @@ Array [
] ]
`; `;
exports[`renders ./components/date-picker/demo/presetted-ranges.tsx extend context correctly 1`] = ` exports[`renders ./components/date-picker/demo/preset-ranges.tsx extend context correctly 1`] = `
<div <div
class="ant-space ant-space-vertical" class="ant-space ant-space-vertical"
> >

View File

@ -2559,7 +2559,7 @@ Array [
] ]
`; `;
exports[`renders ./components/date-picker/demo/presetted-ranges.tsx correctly 1`] = ` exports[`renders ./components/date-picker/demo/preset-ranges.tsx correctly 1`] = `
<div <div
class="ant-space ant-space-vertical" class="ant-space ant-space-vertical"
> >

View File

@ -4,4 +4,4 @@
## en-US ## en-US
Determing which panel to show with `mode` and `onPanelChange`. Determine which panel to show with `mode` and `onPanelChange`.

View File

@ -24,7 +24,7 @@ By clicking the input box, you can select a date from a popup calendar.
<code src="./demo/disabled.tsx">Disabled</code> <code src="./demo/disabled.tsx">Disabled</code>
<code src="./demo/disabled-date.tsx">Disabled Date & Time</code> <code src="./demo/disabled-date.tsx">Disabled Date & Time</code>
<code src="./demo/select-in-range.tsx">Select range dates in 7 days</code> <code src="./demo/select-in-range.tsx">Select range dates in 7 days</code>
<code src="./demo/presetted-ranges.tsx">Preset Ranges</code> <code src="./demo/preset-ranges.tsx">Preset Ranges</code>
<code src="./demo/extra-footer.tsx">Extra Footer</code> <code src="./demo/extra-footer.tsx">Extra Footer</code>
<code src="./demo/size.tsx">Three Sizes</code> <code src="./demo/size.tsx">Three Sizes</code>
<code src="./demo/date-render.tsx">Customized Date Rendering</code> <code src="./demo/date-render.tsx">Customized Date Rendering</code>

View File

@ -25,7 +25,7 @@ demo:
<code src="./demo/disabled.tsx">禁用</code> <code src="./demo/disabled.tsx">禁用</code>
<code src="./demo/disabled-date.tsx">不可选择日期和时间</code> <code src="./demo/disabled-date.tsx">不可选择日期和时间</code>
<code src="./demo/select-in-range.tsx">选择不超过七天的范围</code> <code src="./demo/select-in-range.tsx">选择不超过七天的范围</code>
<code src="./demo/presetted-ranges.tsx">预设范围</code> <code src="./demo/preset-ranges.tsx">预设范围</code>
<code src="./demo/extra-footer.tsx">额外的页脚</code> <code src="./demo/extra-footer.tsx">额外的页脚</code>
<code src="./demo/size.tsx">三种大小</code> <code src="./demo/size.tsx">三种大小</code>
<code src="./demo/date-render.tsx">定制日期单元格</code> <code src="./demo/date-render.tsx">定制日期单元格</code>

View File

@ -80,7 +80,7 @@ describe('Descriptions', () => {
wrapper.unmount(); wrapper.unmount();
}); });
it('warning if ecceed the row span', () => { it('warning if exceed the row span', () => {
resetWarned(); resetWarned();
render( render(

View File

@ -4,4 +4,4 @@
## en-US ## en-US
The default width (or height) of Drawer is `378px`, and there is a presetted large size `736px`. The default width (or height) of Drawer is `378px`, and there is a preset large size `736px`.

View File

@ -29,7 +29,7 @@ A Drawer is a panel that is typically overlaid on top of a page and slides in fr
<code src="./demo/form-in-drawer.tsx">Submit form in drawer</code> <code src="./demo/form-in-drawer.tsx">Submit form in drawer</code>
<code src="./demo/user-profile.tsx">Preview drawer</code> <code src="./demo/user-profile.tsx">Preview drawer</code>
<code src="./demo/multi-level-drawer.tsx">Multi-level drawer</code> <code src="./demo/multi-level-drawer.tsx">Multi-level drawer</code>
<code src="./demo/size.tsx">Presetted size</code> <code src="./demo/size.tsx">Preset size</code>
<code src="./demo/config-provider.tsx" debug>ConfigProvider</code> <code src="./demo/config-provider.tsx" debug>ConfigProvider</code>
<code src="./demo/no-mask.tsx" debug>No mask</code> <code src="./demo/no-mask.tsx" debug>No mask</code>
<code src="./demo/render-panel.tsx" debug>_InternalPanelDoNotUseOrYouWillBeFired</code> <code src="./demo/render-panel.tsx" debug>_InternalPanelDoNotUseOrYouWillBeFired</code>
@ -65,7 +65,7 @@ A Drawer is a panel that is typically overlaid on top of a page and slides in fr
| rootClassName | The class name of the container of the Drawer dialog | string | - | | | rootClassName | The class name of the container of the Drawer dialog | string | - | |
| rootStyle | Style of wrapper element which **contains mask** compare to `style` | CSSProperties | - | | | rootStyle | Style of wrapper element which **contains mask** compare to `style` | CSSProperties | - | |
| style | Style of Drawer panel. Use `bodyStyle` if want to config body only | CSSProperties | - | | | style | Style of Drawer panel. Use `bodyStyle` if want to config body only | CSSProperties | - | |
| size | presetted size of drawer, default `378px` and large `736px` | 'default' \| 'large' | 'default' | 4.17.0 | | size | preset size of drawer, default `378px` and large `736px` | 'default' \| 'large' | 'default' | 4.17.0 |
| title | The title for Drawer | ReactNode | - | | | title | The title for Drawer | ReactNode | - | |
| open | Whether the Drawer dialog is visible or not | boolean | false | | | open | Whether the Drawer dialog is visible or not | boolean | false | |
| width | Width of the Drawer dialog | string \| number | 378 | | | width | Width of the Drawer dialog | string \| number | 378 | |

View File

@ -11,11 +11,11 @@ describe('FloatButton', () => {
const { container } = render(<FloatButton />); const { container } = render(<FloatButton />);
expect(container.firstChild).toMatchSnapshot(); expect(container.firstChild).toMatchSnapshot();
}); });
it('should render <button> when harf not exist', () => { it('should render <button> when href not exist', () => {
const { container } = render(<FloatButton href={undefined} />); const { container } = render(<FloatButton href={undefined} />);
expect(container.querySelector('button')).toBeTruthy(); expect(container.querySelector('button')).toBeTruthy();
}); });
it('should render <a> when harf exist', () => { it('should render <a> when href exist', () => {
const url = 'https://ant.design/index-cn'; const url = 'https://ant.design/index-cn';
const target = '_blank'; const target = '_blank';
const { container } = render(<FloatButton href={url} target={target} />); const { container } = render(<FloatButton href={url} target={target} />);

View File

@ -38,7 +38,7 @@ export interface RowProps extends React.HTMLAttributes<HTMLDivElement> {
function useMergePropByScreen(oriProp: RowProps['align'] | RowProps['justify'], screen: ScreenMap) { function useMergePropByScreen(oriProp: RowProps['align'] | RowProps['justify'], screen: ScreenMap) {
const [prop, setProp] = React.useState(typeof oriProp === 'string' ? oriProp : ''); const [prop, setProp] = React.useState(typeof oriProp === 'string' ? oriProp : '');
const clacMergeAlignOrJustify = () => { const calcMergeAlignOrJustify = () => {
if (typeof oriProp === 'string') { if (typeof oriProp === 'string') {
setProp(oriProp); setProp(oriProp);
} }
@ -58,7 +58,7 @@ function useMergePropByScreen(oriProp: RowProps['align'] | RowProps['justify'],
}; };
React.useEffect(() => { React.useEffect(() => {
clacMergeAlignOrJustify(); calcMergeAlignOrJustify();
}, [JSON.stringify(oriProp), screen]); }, [JSON.stringify(oriProp), screen]);
return prop; return prop;
@ -97,7 +97,7 @@ const Row = React.forwardRef<HTMLDivElement, RowProps>((props, ref) => {
xxl: false, xxl: false,
}); });
// ================================== calc reponsive data ================================== // ================================== calc responsive data ==================================
const mergeAlign = useMergePropByScreen(align, curScreens); const mergeAlign = useMergePropByScreen(align, curScreens);
const mergeJustify = useMergePropByScreen(justify, curScreens); const mergeJustify = useMergePropByScreen(justify, curScreens);

View File

@ -4,4 +4,4 @@
## en-US ## en-US
You can use `scriptUrl` as an array after `@ant-design/icons@4.1.0`, manage icons in one `<Icon />` from multiple [iconfont.cn](http://iconfont.cn/) resources. If icon with a duplicate name in resources, it will overrided in array order. You can use `scriptUrl` as an array after `@ant-design/icons@4.1.0`, manage icons in one `<Icon />` from multiple [iconfont.cn](http://iconfont.cn/) resources. If icon with a duplicate name in resources, it will overridden in array order.

View File

@ -4,7 +4,7 @@ import { Space } from 'antd';
const IconFont = createFromIconfontCN({ const IconFont = createFromIconfontCN({
scriptUrl: [ scriptUrl: [
'//at.alicdn.com/t/font_1788044_0dwu4guekcwr.js', // icon-javascript, icon-java, icon-shoppingcart (overrided) '//at.alicdn.com/t/font_1788044_0dwu4guekcwr.js', // icon-javascript, icon-java, icon-shoppingcart (overridden)
'//at.alicdn.com/t/font_1788592_a5xf2bdic3u.js', // icon-shoppingcart, icon-python '//at.alicdn.com/t/font_1788592_a5xf2bdic3u.js', // icon-shoppingcart, icon-python
], ],
}); });

View File

@ -175,7 +175,7 @@ export const genBasicInputStyle = (token: InputToken): CSSObject => ({
// Reset height for `textarea`s // Reset height for `textarea`s
'textarea&': { 'textarea&': {
maxWidth: '100%', // prevent textearea resize from coming out of its container maxWidth: '100%', // prevent textarea resize from coming out of its container
height: 'auto', height: 'auto',
minHeight: token.controlHeight, minHeight: token.controlHeight,
lineHeight: token.lineHeight, lineHeight: token.lineHeight,

View File

@ -4,4 +4,4 @@
## en-US ## en-US
Configurate `disabled` and `readOnly`. Configure `disabled` and `readOnly`.

View File

@ -53,7 +53,7 @@ describe('Menu', () => {
enter(); enter();
}); });
// React concurrent may delay creat this // React concurrent may delay creating this
triggerAllTimer(); triggerAllTimer();
function getSubMenu() { function getSubMenu() {
@ -71,7 +71,7 @@ describe('Menu', () => {
leave(); leave();
}); });
// React concurrent may delay creat this // React concurrent may delay creating this
triggerAllTimer(); triggerAllTimer();
if (getSubMenu()) { if (getSubMenu()) {

View File

@ -2,7 +2,6 @@
import React from 'react'; import React from 'react';
import { act } from 'react-dom/test-utils'; import { act } from 'react-dom/test-utils';
import { triggerMotionEnd } from './util'; import { triggerMotionEnd } from './util';
import type { ArgsProps } from '..';
import message from '..'; import message from '..';
import ConfigProvider from '../../config-provider'; import ConfigProvider from '../../config-provider';
import { fireEvent, render } from '../../../tests/utils'; import { fireEvent, render } from '../../../tests/utils';
@ -148,7 +147,7 @@ describe('message.hooks', () => {
<button <button
type="button" type="button"
onClick={() => { onClick={() => {
hide = api.open({ ontent: 'nice', duration: 0 } as unknown as ArgsProps); hide = api.open({ content: 'nice', duration: 0 });
}} }}
> >
test test

View File

@ -28,7 +28,7 @@ describe('Pagination', () => {
expect(container.querySelector('button')?.disabled).toBe(true); expect(container.querySelector('button')?.disabled).toBe(true);
}); });
it('should autometically be small when size is not specified', async () => { it('should automatically be small when size is not specified', async () => {
const { container } = render(<Pagination responsive />); const { container } = render(<Pagination responsive />);
expect(container.querySelector('ul')?.className.includes('ant-pagination-mini')).toBe(true); expect(container.querySelector('ul')?.className.includes('ant-pagination-mini')).toBe(true);
}); });

View File

@ -15,13 +15,13 @@ export interface PopoverProps extends AbstractTooltipProps {
content?: React.ReactNode | RenderFunction; content?: React.ReactNode | RenderFunction;
} }
interface OverlayPorps { interface OverlayProps {
prefixCls?: string; prefixCls?: string;
title?: PopoverProps['title']; title?: PopoverProps['title'];
content?: PopoverProps['content']; content?: PopoverProps['content'];
} }
const Overlay: React.FC<OverlayPorps> = ({ title, content, prefixCls }) => { const Overlay: React.FC<OverlayProps> = ({ title, content, prefixCls }) => {
if (!title && !content) { if (!title && !content) {
return null; return null;
} }

View File

@ -180,14 +180,14 @@ describe('Progress', () => {
expect(wrapper.firstChild).toMatchSnapshot(); expect(wrapper.firstChild).toMatchSnapshot();
}); });
it('steps should be changable', () => { it('steps should be changeable', () => {
const { container: wrapper, rerender } = render(<Progress steps={5} percent={60} />); const { container: wrapper, rerender } = render(<Progress steps={5} percent={60} />);
expect(wrapper.querySelectorAll('.ant-progress-steps-item-active').length).toBe(3); expect(wrapper.querySelectorAll('.ant-progress-steps-item-active').length).toBe(3);
rerender(<Progress steps={5} percent={40} />); rerender(<Progress steps={5} percent={40} />);
expect(wrapper.querySelectorAll('.ant-progress-steps-item-active').length).toBe(2); expect(wrapper.querySelectorAll('.ant-progress-steps-item-active').length).toBe(2);
}); });
it('steps should be changable when has strokeColor', () => { it('steps should be changeable when has strokeColor', () => {
const { container: wrapper, rerender } = render( const { container: wrapper, rerender } = render(
<Progress steps={5} percent={60} strokeColor="#1890ff" />, <Progress steps={5} percent={60} strokeColor="#1890ff" />,
); );
@ -224,7 +224,7 @@ describe('Progress', () => {
expect(container.firstChild).toMatchSnapshot(); expect(container.firstChild).toMatchSnapshot();
}); });
it('should warnning if use `progress` in success', () => { it('should warning if use `progress` in success', () => {
const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {}); const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
render(<Progress percent={60} success={{ progress: 30 }} />); render(<Progress percent={60} success={{ progress: 30 }} />);
expect(errorSpy).toHaveBeenCalledWith( expect(errorSpy).toHaveBeenCalledWith(
@ -232,7 +232,7 @@ describe('Progress', () => {
); );
}); });
it('should warnning if use `progress` in success in type Circle', () => { it('should warning if use `progress` in success in type Circle', () => {
const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {}); const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
render(<Progress percent={60} success={{ progress: 30 }} type="circle" />); render(<Progress percent={60} success={{ progress: 30 }} type="circle" />);
expect(errorSpy).toHaveBeenCalledWith( expect(errorSpy).toHaveBeenCalledWith(

View File

@ -39,9 +39,9 @@ describe('QRCode test', () => {
it('support custom size', () => { it('support custom size', () => {
const { container } = render(<QRCode value="test" size={100} />); const { container } = render(<QRCode value="test" size={100} />);
const wapper = container.querySelector<HTMLDivElement>('.ant-qrcode'); const wrapper = container.querySelector<HTMLDivElement>('.ant-qrcode');
expect(wapper?.style?.width).toBe('100px'); expect(wrapper?.style?.width).toBe('100px');
expect(wapper?.style?.height).toBe('100px'); expect(wrapper?.style?.height).toBe('100px');
}); });
it('support refresh', () => { it('support refresh', () => {

View File

@ -156,7 +156,7 @@ Array [
] ]
`; `;
exports[`renders ./components/slider/demo/dragableTrack.tsx extend context correctly 1`] = ` exports[`renders ./components/slider/demo/draggableTrack.tsx extend context correctly 1`] = `
<div <div
class="ant-slider ant-slider-horizontal" class="ant-slider ant-slider-horizontal"
> >

View File

@ -84,7 +84,7 @@ Array [
] ]
`; `;
exports[`renders ./components/slider/demo/dragableTrack.tsx correctly 1`] = ` exports[`renders ./components/slider/demo/draggableTrack.tsx correctly 1`] = `
<div <div
class="ant-slider ant-slider-horizontal" class="ant-slider ant-slider-horizontal"
> >

View File

@ -79,7 +79,7 @@ describe('Slider', () => {
expect(container2.querySelector('.ant-tooltip-content')!).toBeNull(); expect(container2.querySelector('.ant-tooltip-content')!).toBeNull();
}); });
it('when step is null, thumb can only be slided to the specific mark', () => { it('when step is null, thumb can only be slid to the specific mark', () => {
const intentionallyWrongValue = 40; const intentionallyWrongValue = 40;
const marks = { const marks = {
0: '0', 0: '0',
@ -98,7 +98,7 @@ describe('Slider', () => {
expect(container.querySelector('.ant-slider-handle')!.getAttribute('aria-valuenow')).toBe('48'); expect(container.querySelector('.ant-slider-handle')!.getAttribute('aria-valuenow')).toBe('48');
}); });
it('when step is not null, thumb can be slided to the multiples of step', () => { it('when step is not null, thumb can be slid to the multiples of step', () => {
const marks = { const marks = {
0: '0', 0: '0',
48: '48', 48: '48',
@ -111,7 +111,7 @@ describe('Slider', () => {
expect(container.querySelector('.ant-slider-handle')!.getAttribute('aria-valuenow')).toBe('49'); expect(container.querySelector('.ant-slider-handle')!.getAttribute('aria-valuenow')).toBe('49');
}); });
it('when step is undefined, thumb can be slided to the multiples of step', () => { it('when step is undefined, thumb can be slid to the multiples of step', () => {
const marks = { const marks = {
0: '0', 0: '0',
48: '48', 48: '48',

View File

@ -26,7 +26,7 @@ To input a value in a range.
<code src="./demo/vertical.tsx">Vertical</code> <code src="./demo/vertical.tsx">Vertical</code>
<code src="./demo/show-tooltip.tsx">Control visible of ToolTip</code> <code src="./demo/show-tooltip.tsx">Control visible of ToolTip</code>
<code src="./demo/reverse.tsx">Reverse</code> <code src="./demo/reverse.tsx">Reverse</code>
<code src="./demo/dragableTrack.tsx">Draggable track</code> <code src="./demo/draggableTrack.tsx">Draggable track</code>
## API ## API

View File

@ -27,7 +27,7 @@ demo:
<code src="./demo/vertical.tsx">垂直</code> <code src="./demo/vertical.tsx">垂直</code>
<code src="./demo/show-tooltip.tsx">控制 ToolTip 的显示</code> <code src="./demo/show-tooltip.tsx">控制 ToolTip 的显示</code>
<code src="./demo/reverse.tsx">反向</code> <code src="./demo/reverse.tsx">反向</code>
<code src="./demo/dragableTrack.tsx">范围可拖拽</code> <code src="./demo/draggableTrack.tsx">范围可拖拽</code>
## API ## API

View File

@ -20,7 +20,7 @@ exports[`Statistic rtl render component should be rendered correctly in RTL dire
</div> </div>
`; `;
exports[`Statistic support negetive number 1`] = ` exports[`Statistic support negative number 1`] = `
<div <div
class="ant-statistic" class="ant-statistic"
> >

View File

@ -44,14 +44,14 @@ describe('Statistic', () => {
expect(container.querySelector('.ant-statistic-content-value')!.textContent).toEqual('bamboo'); expect(container.querySelector('.ant-statistic-content-value')!.textContent).toEqual('bamboo');
}); });
it('support negetive number', () => { it('support negative number', () => {
const { asFragment } = render( const { asFragment } = render(
<Statistic title="Account Balance (CNY)" value={-112893.12345} precision={2} />, <Statistic title="Account Balance (CNY)" value={-112893.12345} precision={2} />,
); );
expect(asFragment().firstChild).toMatchSnapshot(); expect(asFragment().firstChild).toMatchSnapshot();
}); });
it('allow negetive precision', () => { it('allow negative precision', () => {
[ [
[-1, -1112893.1212, '-1,112,893'], [-1, -1112893.1212, '-1,112,893'],
[-2, -1112893.1212, '-1,112,893'], [-2, -1112893.1212, '-1,112,893'],

View File

@ -546,7 +546,7 @@ describe('Table.filter', () => {
expect(container.querySelectorAll('tbody tr').length).toBe(1); expect(container.querySelectorAll('tbody tr').length).toBe(1);
expect(container.querySelector('tbody tr')?.textContent).toBe('Lucy'); expect(container.querySelector('tbody tr')?.textContent).toBe('Lucy');
// Should properly be overidden by non-null filteredValue // Should properly be overridden by non-null filteredValue
rerender( rerender(
createTable({ createTable({
columns: [ columns: [
@ -561,7 +561,7 @@ describe('Table.filter', () => {
expect(container.querySelectorAll('tbody tr').length).toBe(1); expect(container.querySelectorAll('tbody tr').length).toBe(1);
expect(container.querySelector('tbody tr')?.textContent).toBe('Tom'); expect(container.querySelector('tbody tr')?.textContent).toBe('Tom');
// Should properly be overidden by a null filteredValue // Should properly be overridden by a null filteredValue
rerender( rerender(
createTable({ createTable({
columns: [ columns: [
@ -990,7 +990,7 @@ describe('Table.filter', () => {
}); });
// https://github.com/ant-design/ant-design/issues/17833 // https://github.com/ant-design/ant-design/issues/17833
it('should not trigger onChange when bluring custom filterDropdown', () => { it('should not trigger onChange when blurring custom filterDropdown', () => {
const onChange = jest.fn(); const onChange = jest.fn();
const filterDropdown = ({ setSelectedKeys }: FilterDropdownProps) => ( const filterDropdown = ({ setSelectedKeys }: FilterDropdownProps) => (
<input onChange={(e) => setSelectedKeys([e.target.value])} /> <input onChange={(e) => setSelectedKeys([e.target.value])} />
@ -1569,7 +1569,7 @@ describe('Table.filter', () => {
const { container } = render(createTable({ columns: [filterControlledColumn] })); const { container } = render(createTable({ columns: [filterControlledColumn] }));
fireEvent.click(container.querySelector('.ant-dropdown-trigger')!); fireEvent.click(container.querySelector('.ant-dropdown-trigger')!);
fireEvent.click(container.querySelector('.ant-dropdown-menu-item')!); fireEvent.click(container.querySelector('.ant-dropdown-menu-item')!);
fireEvent.click(container.querySelector('.ant-table-filter-dropdown-btns .ant-btn-primary')!); // close drodown fireEvent.click(container.querySelector('.ant-table-filter-dropdown-btns .ant-btn-primary')!); // close dropdown
fireEvent.click(container.querySelector('.ant-dropdown-trigger')!); // reopen fireEvent.click(container.querySelector('.ant-dropdown-trigger')!); // reopen
const checkbox = container const checkbox = container
?.querySelector('.ant-dropdown-menu-item') ?.querySelector('.ant-dropdown-menu-item')

View File

@ -817,9 +817,9 @@ describe('Table.rowSelection', () => {
dataSource={data} dataSource={data}
/>, />,
); );
const checkboxs = container.querySelectorAll('.ant-checkbox'); const checkboxes = container.querySelectorAll('.ant-checkbox');
expect(checkboxs.length).toBe(5); expect(checkboxes.length).toBe(5);
checkboxs.forEach((checkbox) => { checkboxes.forEach((checkbox) => {
expect(checkbox.querySelector('input')?.checked).toBe(true); expect(checkbox.querySelector('input')?.checked).toBe(true);
expect(checkbox.className.includes('ant-checkbox-indeterminate')).toBe(false); expect(checkbox.className.includes('ant-checkbox-indeterminate')).toBe(false);
}); });
@ -929,7 +929,7 @@ describe('Table.rowSelection', () => {
}); });
it('render correctly when set childrenColumnName', () => { it('render correctly when set childrenColumnName', () => {
const newDatas = [ const newData = [
{ {
key: 1, key: 1,
name: 'Jack', name: 'Jack',
@ -952,7 +952,7 @@ describe('Table.rowSelection', () => {
}, },
]; ];
const { container } = render( const { container } = render(
<Table columns={columns} dataSource={newDatas} childrenColumnName="test" rowSelection={{}} />, <Table columns={columns} dataSource={newData} childrenColumnName="test" rowSelection={{}} />,
); );
const checkboxes = container.querySelectorAll('input'); const checkboxes = container.querySelectorAll('input');
const objectContaining: { checked?: boolean; indeterminate?: boolean } = {}; const objectContaining: { checked?: boolean; indeterminate?: boolean } = {};
@ -970,7 +970,7 @@ describe('Table.rowSelection', () => {
// https://github.com/ant-design/ant-design/issues/16614 // https://github.com/ant-design/ant-design/issues/16614
it('should get selectedRows correctly when set childrenColumnName', () => { it('should get selectedRows correctly when set childrenColumnName', () => {
const onChange = jest.fn(); const onChange = jest.fn();
const newDatas = [ const newData = [
{ {
key: 1, key: 1,
name: 'Jack', name: 'Jack',
@ -985,7 +985,7 @@ describe('Table.rowSelection', () => {
const { container } = render( const { container } = render(
<Table <Table
columns={columns} columns={columns}
dataSource={newDatas} dataSource={newData}
childrenColumnName="list" childrenColumnName="list"
rowSelection={{ onChange }} rowSelection={{ onChange }}
expandedRowKeys={[1]} expandedRowKeys={[1]}
@ -995,12 +995,12 @@ describe('Table.rowSelection', () => {
fireEvent.click(checkboxes[2]); fireEvent.click(checkboxes[2]);
expect(onChange).toHaveBeenLastCalledWith([11], [newDatas[0].list[0]], { type: 'single' }); expect(onChange).toHaveBeenLastCalledWith([11], [newData[0].list[0]], { type: 'single' });
onChange.mockReset(); onChange.mockReset();
fireEvent.click(checkboxes[1]); fireEvent.click(checkboxes[1]);
const item0 = newDatas[0]; const item0 = newData[0];
expect(onChange).toHaveBeenLastCalledWith([11, 1], [newDatas[0].list[0], item0], { expect(onChange).toHaveBeenLastCalledWith([11, 1], [newData[0].list[0], item0], {
type: 'single', type: 'single',
}); });
}); });
@ -1082,7 +1082,7 @@ describe('Table.rowSelection', () => {
).toBeTruthy(); ).toBeTruthy();
}); });
it('should make select all indeterminated when each item is disabled and some item is checked', () => { it('should make select all indeterminate when each item is disabled and some item is checked', () => {
const { container } = render( const { container } = render(
createTable({ createTable({
rowSelection: { rowSelection: {
@ -1212,8 +1212,8 @@ describe('Table.rowSelection', () => {
/>, />,
); );
const checkboxs = container.querySelectorAll('input'); const checkboxes = container.querySelectorAll('input');
fireEvent.click(checkboxs[checkboxs.length - 1]); fireEvent.click(checkboxes[checkboxes.length - 1]);
expect(onChange.mock.calls[0][1]).toEqual([expect.objectContaining({ name: 'bamboo' })]); expect(onChange.mock.calls[0][1]).toEqual([expect.objectContaining({ name: 'bamboo' })]);
}); });
@ -1593,7 +1593,7 @@ describe('Table.rowSelection', () => {
); );
}); });
it('works with receive selectedRowKeys fron [] to undefined', () => { it('works with receive selectedRowKeys from [] to undefined', () => {
const onChange = jest.fn(); const onChange = jest.fn();
const dataSource = [{ name: 'Jack' }]; const dataSource = [{ name: 'Jack' }];
const { container, rerender } = render( const { container, rerender } = render(

View File

@ -81,7 +81,7 @@ describe('Table.sorter', () => {
expect(getNameColumn()?.getAttribute('aria-sort')).toEqual(null); expect(getNameColumn()?.getAttribute('aria-sort')).toEqual(null);
}); });
it('should have aria-lable if the column is sortable and is not sorted', () => { it('should have aria-label if the column is sortable and is not sorted', () => {
const { container } = render( const { container } = render(
createTable( createTable(
{ {
@ -778,7 +778,7 @@ describe('Table.sorter', () => {
}); });
// https://github.com/ant-design/ant-design/issues/19443 // https://github.com/ant-design/ant-design/issues/19443
it('should not being inifinite loop when using Table.Column with sortOrder', () => { it('should not being infinite loop when using Table.Column with sortOrder', () => {
const Demo: React.FC = () => ( const Demo: React.FC = () => (
<Table dataSource={[]}> <Table dataSource={[]}>
<Table.Column title="Age" dataIndex="age" sorter sortOrder="ascend" key="age" /> <Table.Column title="Age" dataIndex="age" sorter sortOrder="ascend" key="age" />

View File

@ -5092,7 +5092,7 @@ exports[`renders ./components/table/demo/edit-row.tsx extend context correctly 1
<td <td
class="ant-table-cell" class="ant-table-cell"
> >
Edrward 0 Edward 0
</td> </td>
<td <td
class="ant-table-cell" class="ant-table-cell"
@ -5121,7 +5121,7 @@ exports[`renders ./components/table/demo/edit-row.tsx extend context correctly 1
<td <td
class="ant-table-cell" class="ant-table-cell"
> >
Edrward 1 Edward 1
</td> </td>
<td <td
class="ant-table-cell" class="ant-table-cell"
@ -5150,7 +5150,7 @@ exports[`renders ./components/table/demo/edit-row.tsx extend context correctly 1
<td <td
class="ant-table-cell" class="ant-table-cell"
> >
Edrward 2 Edward 2
</td> </td>
<td <td
class="ant-table-cell" class="ant-table-cell"
@ -5179,7 +5179,7 @@ exports[`renders ./components/table/demo/edit-row.tsx extend context correctly 1
<td <td
class="ant-table-cell" class="ant-table-cell"
> >
Edrward 3 Edward 3
</td> </td>
<td <td
class="ant-table-cell" class="ant-table-cell"
@ -5208,7 +5208,7 @@ exports[`renders ./components/table/demo/edit-row.tsx extend context correctly 1
<td <td
class="ant-table-cell" class="ant-table-cell"
> >
Edrward 4 Edward 4
</td> </td>
<td <td
class="ant-table-cell" class="ant-table-cell"
@ -5237,7 +5237,7 @@ exports[`renders ./components/table/demo/edit-row.tsx extend context correctly 1
<td <td
class="ant-table-cell" class="ant-table-cell"
> >
Edrward 5 Edward 5
</td> </td>
<td <td
class="ant-table-cell" class="ant-table-cell"
@ -5266,7 +5266,7 @@ exports[`renders ./components/table/demo/edit-row.tsx extend context correctly 1
<td <td
class="ant-table-cell" class="ant-table-cell"
> >
Edrward 6 Edward 6
</td> </td>
<td <td
class="ant-table-cell" class="ant-table-cell"
@ -5295,7 +5295,7 @@ exports[`renders ./components/table/demo/edit-row.tsx extend context correctly 1
<td <td
class="ant-table-cell" class="ant-table-cell"
> >
Edrward 7 Edward 7
</td> </td>
<td <td
class="ant-table-cell" class="ant-table-cell"
@ -5324,7 +5324,7 @@ exports[`renders ./components/table/demo/edit-row.tsx extend context correctly 1
<td <td
class="ant-table-cell" class="ant-table-cell"
> >
Edrward 8 Edward 8
</td> </td>
<td <td
class="ant-table-cell" class="ant-table-cell"
@ -5353,7 +5353,7 @@ exports[`renders ./components/table/demo/edit-row.tsx extend context correctly 1
<td <td
class="ant-table-cell" class="ant-table-cell"
> >
Edrward 9 Edward 9
</td> </td>
<td <td
class="ant-table-cell" class="ant-table-cell"
@ -9493,7 +9493,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.tsx extend context
class="ant-table-cell ant-table-cell-fix-left" class="ant-table-cell ant-table-cell-fix-left"
style="position:sticky;left:0" style="position:sticky;left:0"
> >
Edrward 0 Edward 0
</td> </td>
<td <td
class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last" class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last"
@ -9558,7 +9558,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.tsx extend context
class="ant-table-cell ant-table-cell-fix-left" class="ant-table-cell ant-table-cell-fix-left"
style="position:sticky;left:0" style="position:sticky;left:0"
> >
Edrward 1 Edward 1
</td> </td>
<td <td
class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last" class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last"
@ -9623,7 +9623,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.tsx extend context
class="ant-table-cell ant-table-cell-fix-left" class="ant-table-cell ant-table-cell-fix-left"
style="position:sticky;left:0" style="position:sticky;left:0"
> >
Edrward 2 Edward 2
</td> </td>
<td <td
class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last" class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last"
@ -9688,7 +9688,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.tsx extend context
class="ant-table-cell ant-table-cell-fix-left" class="ant-table-cell ant-table-cell-fix-left"
style="position:sticky;left:0" style="position:sticky;left:0"
> >
Edrward 3 Edward 3
</td> </td>
<td <td
class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last" class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last"
@ -9753,7 +9753,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.tsx extend context
class="ant-table-cell ant-table-cell-fix-left" class="ant-table-cell ant-table-cell-fix-left"
style="position:sticky;left:0" style="position:sticky;left:0"
> >
Edrward 4 Edward 4
</td> </td>
<td <td
class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last" class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last"
@ -9818,7 +9818,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.tsx extend context
class="ant-table-cell ant-table-cell-fix-left" class="ant-table-cell ant-table-cell-fix-left"
style="position:sticky;left:0" style="position:sticky;left:0"
> >
Edrward 5 Edward 5
</td> </td>
<td <td
class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last" class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last"
@ -9883,7 +9883,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.tsx extend context
class="ant-table-cell ant-table-cell-fix-left" class="ant-table-cell ant-table-cell-fix-left"
style="position:sticky;left:0" style="position:sticky;left:0"
> >
Edrward 6 Edward 6
</td> </td>
<td <td
class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last" class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last"
@ -9948,7 +9948,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.tsx extend context
class="ant-table-cell ant-table-cell-fix-left" class="ant-table-cell ant-table-cell-fix-left"
style="position:sticky;left:0" style="position:sticky;left:0"
> >
Edrward 7 Edward 7
</td> </td>
<td <td
class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last" class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last"
@ -10013,7 +10013,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.tsx extend context
class="ant-table-cell ant-table-cell-fix-left" class="ant-table-cell ant-table-cell-fix-left"
style="position:sticky;left:0" style="position:sticky;left:0"
> >
Edrward 8 Edward 8
</td> </td>
<td <td
class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last" class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last"
@ -10078,7 +10078,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.tsx extend context
class="ant-table-cell ant-table-cell-fix-left" class="ant-table-cell ant-table-cell-fix-left"
style="position:sticky;left:0" style="position:sticky;left:0"
> >
Edrward 9 Edward 9
</td> </td>
<td <td
class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last" class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last"
@ -26993,7 +26993,7 @@ exports[`renders ./components/table/demo/sticky.tsx extend context correctly 1`]
class="ant-table-cell ant-table-cell-fix-left" class="ant-table-cell ant-table-cell-fix-left"
style="position:sticky;left:0" style="position:sticky;left:0"
> >
Edrward 0 Edward 0
</td> </td>
<td <td
class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last" class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last"
@ -27058,7 +27058,7 @@ exports[`renders ./components/table/demo/sticky.tsx extend context correctly 1`]
class="ant-table-cell ant-table-cell-fix-left" class="ant-table-cell ant-table-cell-fix-left"
style="position:sticky;left:0" style="position:sticky;left:0"
> >
Edrward 1 Edward 1
</td> </td>
<td <td
class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last" class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last"
@ -27123,7 +27123,7 @@ exports[`renders ./components/table/demo/sticky.tsx extend context correctly 1`]
class="ant-table-cell ant-table-cell-fix-left" class="ant-table-cell ant-table-cell-fix-left"
style="position:sticky;left:0" style="position:sticky;left:0"
> >
Edrward 2 Edward 2
</td> </td>
<td <td
class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last" class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last"
@ -27188,7 +27188,7 @@ exports[`renders ./components/table/demo/sticky.tsx extend context correctly 1`]
class="ant-table-cell ant-table-cell-fix-left" class="ant-table-cell ant-table-cell-fix-left"
style="position:sticky;left:0" style="position:sticky;left:0"
> >
Edrward 3 Edward 3
</td> </td>
<td <td
class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last" class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last"
@ -27253,7 +27253,7 @@ exports[`renders ./components/table/demo/sticky.tsx extend context correctly 1`]
class="ant-table-cell ant-table-cell-fix-left" class="ant-table-cell ant-table-cell-fix-left"
style="position:sticky;left:0" style="position:sticky;left:0"
> >
Edrward 4 Edward 4
</td> </td>
<td <td
class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last" class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last"
@ -27318,7 +27318,7 @@ exports[`renders ./components/table/demo/sticky.tsx extend context correctly 1`]
class="ant-table-cell ant-table-cell-fix-left" class="ant-table-cell ant-table-cell-fix-left"
style="position:sticky;left:0" style="position:sticky;left:0"
> >
Edrward 5 Edward 5
</td> </td>
<td <td
class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last" class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last"
@ -27383,7 +27383,7 @@ exports[`renders ./components/table/demo/sticky.tsx extend context correctly 1`]
class="ant-table-cell ant-table-cell-fix-left" class="ant-table-cell ant-table-cell-fix-left"
style="position:sticky;left:0" style="position:sticky;left:0"
> >
Edrward 6 Edward 6
</td> </td>
<td <td
class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last" class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last"
@ -27448,7 +27448,7 @@ exports[`renders ./components/table/demo/sticky.tsx extend context correctly 1`]
class="ant-table-cell ant-table-cell-fix-left" class="ant-table-cell ant-table-cell-fix-left"
style="position:sticky;left:0" style="position:sticky;left:0"
> >
Edrward 7 Edward 7
</td> </td>
<td <td
class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last" class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last"
@ -27513,7 +27513,7 @@ exports[`renders ./components/table/demo/sticky.tsx extend context correctly 1`]
class="ant-table-cell ant-table-cell-fix-left" class="ant-table-cell ant-table-cell-fix-left"
style="position:sticky;left:0" style="position:sticky;left:0"
> >
Edrward 8 Edward 8
</td> </td>
<td <td
class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last" class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last"
@ -27578,7 +27578,7 @@ exports[`renders ./components/table/demo/sticky.tsx extend context correctly 1`]
class="ant-table-cell ant-table-cell-fix-left" class="ant-table-cell ant-table-cell-fix-left"
style="position:sticky;left:0" style="position:sticky;left:0"
> >
Edrward 9 Edward 9
</td> </td>
<td <td
class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last" class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last"

View File

@ -4372,7 +4372,7 @@ exports[`renders ./components/table/demo/edit-row.tsx correctly 1`] = `
<td <td
class="ant-table-cell" class="ant-table-cell"
> >
Edrward 0 Edward 0
</td> </td>
<td <td
class="ant-table-cell" class="ant-table-cell"
@ -4401,7 +4401,7 @@ exports[`renders ./components/table/demo/edit-row.tsx correctly 1`] = `
<td <td
class="ant-table-cell" class="ant-table-cell"
> >
Edrward 1 Edward 1
</td> </td>
<td <td
class="ant-table-cell" class="ant-table-cell"
@ -4430,7 +4430,7 @@ exports[`renders ./components/table/demo/edit-row.tsx correctly 1`] = `
<td <td
class="ant-table-cell" class="ant-table-cell"
> >
Edrward 2 Edward 2
</td> </td>
<td <td
class="ant-table-cell" class="ant-table-cell"
@ -4459,7 +4459,7 @@ exports[`renders ./components/table/demo/edit-row.tsx correctly 1`] = `
<td <td
class="ant-table-cell" class="ant-table-cell"
> >
Edrward 3 Edward 3
</td> </td>
<td <td
class="ant-table-cell" class="ant-table-cell"
@ -4488,7 +4488,7 @@ exports[`renders ./components/table/demo/edit-row.tsx correctly 1`] = `
<td <td
class="ant-table-cell" class="ant-table-cell"
> >
Edrward 4 Edward 4
</td> </td>
<td <td
class="ant-table-cell" class="ant-table-cell"
@ -4517,7 +4517,7 @@ exports[`renders ./components/table/demo/edit-row.tsx correctly 1`] = `
<td <td
class="ant-table-cell" class="ant-table-cell"
> >
Edrward 5 Edward 5
</td> </td>
<td <td
class="ant-table-cell" class="ant-table-cell"
@ -4546,7 +4546,7 @@ exports[`renders ./components/table/demo/edit-row.tsx correctly 1`] = `
<td <td
class="ant-table-cell" class="ant-table-cell"
> >
Edrward 6 Edward 6
</td> </td>
<td <td
class="ant-table-cell" class="ant-table-cell"
@ -4575,7 +4575,7 @@ exports[`renders ./components/table/demo/edit-row.tsx correctly 1`] = `
<td <td
class="ant-table-cell" class="ant-table-cell"
> >
Edrward 7 Edward 7
</td> </td>
<td <td
class="ant-table-cell" class="ant-table-cell"
@ -4604,7 +4604,7 @@ exports[`renders ./components/table/demo/edit-row.tsx correctly 1`] = `
<td <td
class="ant-table-cell" class="ant-table-cell"
> >
Edrward 8 Edward 8
</td> </td>
<td <td
class="ant-table-cell" class="ant-table-cell"
@ -4633,7 +4633,7 @@ exports[`renders ./components/table/demo/edit-row.tsx correctly 1`] = `
<td <td
class="ant-table-cell" class="ant-table-cell"
> >
Edrward 9 Edward 9
</td> </td>
<td <td
class="ant-table-cell" class="ant-table-cell"
@ -7233,7 +7233,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.tsx correctly 1`]
class="ant-table-cell ant-table-cell-fix-left" class="ant-table-cell ant-table-cell-fix-left"
style="position:sticky;left:0" style="position:sticky;left:0"
> >
Edrward 0 Edward 0
</td> </td>
<td <td
class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last" class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last"
@ -7298,7 +7298,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.tsx correctly 1`]
class="ant-table-cell ant-table-cell-fix-left" class="ant-table-cell ant-table-cell-fix-left"
style="position:sticky;left:0" style="position:sticky;left:0"
> >
Edrward 1 Edward 1
</td> </td>
<td <td
class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last" class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last"
@ -7363,7 +7363,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.tsx correctly 1`]
class="ant-table-cell ant-table-cell-fix-left" class="ant-table-cell ant-table-cell-fix-left"
style="position:sticky;left:0" style="position:sticky;left:0"
> >
Edrward 2 Edward 2
</td> </td>
<td <td
class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last" class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last"
@ -7428,7 +7428,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.tsx correctly 1`]
class="ant-table-cell ant-table-cell-fix-left" class="ant-table-cell ant-table-cell-fix-left"
style="position:sticky;left:0" style="position:sticky;left:0"
> >
Edrward 3 Edward 3
</td> </td>
<td <td
class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last" class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last"
@ -7493,7 +7493,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.tsx correctly 1`]
class="ant-table-cell ant-table-cell-fix-left" class="ant-table-cell ant-table-cell-fix-left"
style="position:sticky;left:0" style="position:sticky;left:0"
> >
Edrward 4 Edward 4
</td> </td>
<td <td
class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last" class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last"
@ -7558,7 +7558,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.tsx correctly 1`]
class="ant-table-cell ant-table-cell-fix-left" class="ant-table-cell ant-table-cell-fix-left"
style="position:sticky;left:0" style="position:sticky;left:0"
> >
Edrward 5 Edward 5
</td> </td>
<td <td
class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last" class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last"
@ -7623,7 +7623,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.tsx correctly 1`]
class="ant-table-cell ant-table-cell-fix-left" class="ant-table-cell ant-table-cell-fix-left"
style="position:sticky;left:0" style="position:sticky;left:0"
> >
Edrward 6 Edward 6
</td> </td>
<td <td
class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last" class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last"
@ -7688,7 +7688,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.tsx correctly 1`]
class="ant-table-cell ant-table-cell-fix-left" class="ant-table-cell ant-table-cell-fix-left"
style="position:sticky;left:0" style="position:sticky;left:0"
> >
Edrward 7 Edward 7
</td> </td>
<td <td
class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last" class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last"
@ -7753,7 +7753,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.tsx correctly 1`]
class="ant-table-cell ant-table-cell-fix-left" class="ant-table-cell ant-table-cell-fix-left"
style="position:sticky;left:0" style="position:sticky;left:0"
> >
Edrward 8 Edward 8
</td> </td>
<td <td
class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last" class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last"
@ -7818,7 +7818,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.tsx correctly 1`]
class="ant-table-cell ant-table-cell-fix-left" class="ant-table-cell ant-table-cell-fix-left"
style="position:sticky;left:0" style="position:sticky;left:0"
> >
Edrward 9 Edward 9
</td> </td>
<td <td
class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last" class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last"
@ -21484,7 +21484,7 @@ exports[`renders ./components/table/demo/sticky.tsx correctly 1`] = `
class="ant-table-cell ant-table-cell-fix-left" class="ant-table-cell ant-table-cell-fix-left"
style="position:sticky;left:0" style="position:sticky;left:0"
> >
Edrward 0 Edward 0
</td> </td>
<td <td
class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last" class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last"
@ -21549,7 +21549,7 @@ exports[`renders ./components/table/demo/sticky.tsx correctly 1`] = `
class="ant-table-cell ant-table-cell-fix-left" class="ant-table-cell ant-table-cell-fix-left"
style="position:sticky;left:0" style="position:sticky;left:0"
> >
Edrward 1 Edward 1
</td> </td>
<td <td
class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last" class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last"
@ -21614,7 +21614,7 @@ exports[`renders ./components/table/demo/sticky.tsx correctly 1`] = `
class="ant-table-cell ant-table-cell-fix-left" class="ant-table-cell ant-table-cell-fix-left"
style="position:sticky;left:0" style="position:sticky;left:0"
> >
Edrward 2 Edward 2
</td> </td>
<td <td
class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last" class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last"
@ -21679,7 +21679,7 @@ exports[`renders ./components/table/demo/sticky.tsx correctly 1`] = `
class="ant-table-cell ant-table-cell-fix-left" class="ant-table-cell ant-table-cell-fix-left"
style="position:sticky;left:0" style="position:sticky;left:0"
> >
Edrward 3 Edward 3
</td> </td>
<td <td
class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last" class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last"
@ -21744,7 +21744,7 @@ exports[`renders ./components/table/demo/sticky.tsx correctly 1`] = `
class="ant-table-cell ant-table-cell-fix-left" class="ant-table-cell ant-table-cell-fix-left"
style="position:sticky;left:0" style="position:sticky;left:0"
> >
Edrward 4 Edward 4
</td> </td>
<td <td
class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last" class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last"
@ -21809,7 +21809,7 @@ exports[`renders ./components/table/demo/sticky.tsx correctly 1`] = `
class="ant-table-cell ant-table-cell-fix-left" class="ant-table-cell ant-table-cell-fix-left"
style="position:sticky;left:0" style="position:sticky;left:0"
> >
Edrward 5 Edward 5
</td> </td>
<td <td
class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last" class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last"
@ -21874,7 +21874,7 @@ exports[`renders ./components/table/demo/sticky.tsx correctly 1`] = `
class="ant-table-cell ant-table-cell-fix-left" class="ant-table-cell ant-table-cell-fix-left"
style="position:sticky;left:0" style="position:sticky;left:0"
> >
Edrward 6 Edward 6
</td> </td>
<td <td
class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last" class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last"
@ -21939,7 +21939,7 @@ exports[`renders ./components/table/demo/sticky.tsx correctly 1`] = `
class="ant-table-cell ant-table-cell-fix-left" class="ant-table-cell ant-table-cell-fix-left"
style="position:sticky;left:0" style="position:sticky;left:0"
> >
Edrward 7 Edward 7
</td> </td>
<td <td
class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last" class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last"
@ -22004,7 +22004,7 @@ exports[`renders ./components/table/demo/sticky.tsx correctly 1`] = `
class="ant-table-cell ant-table-cell-fix-left" class="ant-table-cell ant-table-cell-fix-left"
style="position:sticky;left:0" style="position:sticky;left:0"
> >
Edrward 8 Edward 8
</td> </td>
<td <td
class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last" class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last"
@ -22069,7 +22069,7 @@ exports[`renders ./components/table/demo/sticky.tsx correctly 1`] = `
class="ant-table-cell ant-table-cell-fix-left" class="ant-table-cell ant-table-cell-fix-left"
style="position:sticky;left:0" style="position:sticky;left:0"
> >
Edrward 9 Edward 9
</td> </td>
<td <td
class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last" class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last"

View File

@ -12,7 +12,7 @@ const originData: Item[] = [];
for (let i = 0; i < 100; i++) { for (let i = 0; i < 100; i++) {
originData.push({ originData.push({
key: i.toString(), key: i.toString(),
name: `Edrward ${i}`, name: `Edward ${i}`,
age: 32, age: 32,
address: `London Park no. ${i}`, address: `London Park no. ${i}`,
}); });

View File

@ -80,7 +80,7 @@ const data: DataType[] = [];
for (let i = 0; i < 100; i++) { for (let i = 0; i < 100; i++) {
data.push({ data.push({
key: i, key: i,
name: `Edrward ${i}`, name: `Edward ${i}`,
age: 32, age: 32,
address: `London Park no. ${i}`, address: `London Park no. ${i}`,
}); });

View File

@ -53,9 +53,9 @@ const App: React.FC = () => {
{ {
key: 'odd', key: 'odd',
text: 'Select Odd Row', text: 'Select Odd Row',
onSelect: (changableRowKeys) => { onSelect: (changeableRowKeys) => {
let newSelectedRowKeys = []; let newSelectedRowKeys = [];
newSelectedRowKeys = changableRowKeys.filter((_, index) => { newSelectedRowKeys = changeableRowKeys.filter((_, index) => {
if (index % 2 !== 0) { if (index % 2 !== 0) {
return false; return false;
} }
@ -67,9 +67,9 @@ const App: React.FC = () => {
{ {
key: 'even', key: 'even',
text: 'Select Even Row', text: 'Select Even Row',
onSelect: (changableRowKeys) => { onSelect: (changeableRowKeys) => {
let newSelectedRowKeys = []; let newSelectedRowKeys = [];
newSelectedRowKeys = changableRowKeys.filter((_, index) => { newSelectedRowKeys = changeableRowKeys.filter((_, index) => {
if (index % 2 !== 0) { if (index % 2 !== 0) {
return true; return true;
} }

View File

@ -80,7 +80,7 @@ const data: DataType[] = [];
for (let i = 0; i < 100; i++) { for (let i = 0; i < 100; i++) {
data.push({ data.push({
key: i, key: i,
name: `Edrward ${i}`, name: `Edward ${i}`,
age: 32, age: 32,
address: `London Park no. ${i}`, address: `London Park no. ${i}`,
}); });

View File

@ -276,7 +276,7 @@ function FilterDropdown<RecordType>(props: FilterDropdownProps<RecordType>) {
const onVisibleChange = (newVisible: boolean) => { const onVisibleChange = (newVisible: boolean) => {
if (newVisible && propFilteredKeys !== undefined) { if (newVisible && propFilteredKeys !== undefined) {
// Sync filteredKeys on appear in controlled mode (propFilteredKeys !== undefiend) // Sync filteredKeys on appear in controlled mode (propFilteredKeys !== undefined)
setFilteredKeysSync(propFilteredKeys || []); setFilteredKeysSync(propFilteredKeys || []);
} }

View File

@ -344,7 +344,7 @@ You can set `hideOnSinglePage` with `pagination` prop.
### Table will return to first page when filter data. ### Table will return to first page when filter data.
Table total page count usually reduce after filter data, we defaultly return to first page in case of current page is out of filtered results. Table total page count usually reduce after filter data, we by default return to first page in case of current page is out of filtered results.
You may need to keep current page after filtering when fetch data from remote service, please check [this demo](https://codesandbox.io/s/yuanchengjiazaishuju-ant-design-demo-7y2uf) as workaround. You may need to keep current page after filtering when fetch data from remote service, please check [this demo](https://codesandbox.io/s/yuanchengjiazaishuju-ant-design-demo-7y2uf) as workaround.

View File

@ -63,7 +63,7 @@ describe('Transfer.Search', () => {
jest.useRealTimers(); jest.useRealTimers();
}); });
it('legacy props#onSearchChange doesnot work anymore', () => { it('legacy props#onSearchChange does not work anymore', () => {
const onSearchChange = jest.fn(); const onSearchChange = jest.fn();
const props = { onSearchChange }; const props = { onSearchChange };
const { container } = render(<Transfer render={(item) => item.title!} {...props} showSearch />); const { container } = render(<Transfer render={(item) => item.title!} {...props} showSearch />);

View File

@ -4,4 +4,4 @@
## en-US ## en-US
Custom the labels for select all checkboxs. Custom the labels for select all checkboxes.

View File

@ -4,4 +4,4 @@
## en-US ## en-US
Tree with connected line between nodes, turn on by `showLine`, customize the preseted icon by `switcherIcon`. Tree with connected line between nodes, turn on by `showLine`, customize the preset icon by `switcherIcon`.

View File

@ -242,7 +242,7 @@ describe('Typography', () => {
function testStep( function testStep(
{ name = '', icon, tooltip, triggerType, enterIcon }: EditableConfig, { name = '', icon, tooltip, triggerType, enterIcon }: EditableConfig,
submitFunc?: (container: ReturnType<typeof render>['container']) => void, submitFunc?: (container: ReturnType<typeof render>['container']) => void,
expectFunc?: (callbake: jest.Mock) => void, expectFunc?: (callback: jest.Mock) => void,
) { ) {
it(name, async () => { it(name, async () => {
jest.useFakeTimers(); jest.useFakeTimers();

View File

@ -1,7 +1,7 @@
import type { FullToken, GenerateStyle } from '../../theme/internal'; import type { FullToken, GenerateStyle } from '../../theme/internal';
import { genComponentStyleHook } from '../../theme/internal'; import { genComponentStyleHook } from '../../theme/internal';
import { import {
getCopiableStyles, getCopyableStyles,
getEditableStyles, getEditableStyles,
getEllipsisStyles, getEllipsisStyles,
getLinkStyles, getLinkStyles,
@ -110,7 +110,7 @@ const genTypographyStyle: GenerateStyle<TypographyToken> = (token) => {
...getEditableStyles(token), ...getEditableStyles(token),
...getCopiableStyles(token), ...getCopyableStyles(token),
...getEllipsisStyles(), ...getEllipsisStyles(),

View File

@ -223,7 +223,7 @@ export const getEditableStyles: GenerateStyle<TypographyToken, CSSObject> = (tok
}; };
}; };
export const getCopiableStyles: GenerateStyle<TypographyToken, CSSObject> = (token) => ({ export const getCopyableStyles: GenerateStyle<TypographyToken, CSSObject> = (token) => ({
'&-copy-success': { '&-copy-success': {
[` [`
&, &,

View File

@ -8,4 +8,4 @@
You can drag files to a specific area, to upload. Alternatively, you can also upload by selecting. You can drag files to a specific area, to upload. Alternatively, you can also upload by selecting.
We can upload serveral files at once in modern browsers by giving the input the `multiple` attribute. We can upload several files at once in modern browsers by giving the input the `multiple` attribute.

View File

@ -8,7 +8,7 @@
## en-US ## en-US
You can gain full control over filelist by configuring `fileList`. You can accomplish all kinds of customed functions. The following shows two circumstances: You can gain full control over filelist by configuring `fileList`. You can accomplish all kinds of customized functions. The following shows two circumstances:
1. limit the number of uploaded files. 1. limit the number of uploaded files.

View File

@ -20,7 +20,7 @@ To help users quickly and clearly understand the meanings of data, analyze trend
<img src="https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*v6FAS7wJ4TUAAAAAAAAAAABkARQnAQ" /> <img src="https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*v6FAS7wJ4TUAAAAAAAAAAABkARQnAQ" />
<div> <div>
<h4>Organized</h4> <h4>Organized</h4>
<p>Define the layout logically, prioritize the content in order. In most cases, in order to emphasize the common-used analysis thoughts, you should organize the information from top to bottom and from left to right, or use processive interactions. To sum up, put the summary first, then focus on filters, and finally provide details whenever the user needs.</p> <p>Define the layout logically, prioritize the content in order. In most cases, in order to emphasize the common-used analysis thoughts, you should organize the information from top to bottom and from left to right, or use progressive interactions. To sum up, put the summary first, then focus on filters, and finally provide details whenever the user needs.</p>
</div> </div>
</div> </div>
<div> <div>

View File

@ -202,7 +202,7 @@
"cheerio": "1.0.0-rc.12", "cheerio": "1.0.0-rc.12",
"cross-env": "^7.0.0", "cross-env": "^7.0.0",
"dekko": "^0.2.1", "dekko": "^0.2.1",
"dumi": "^2.0.17", "dumi": "^2.1.13",
"duplicate-package-checker-webpack-plugin": "^3.0.0", "duplicate-package-checker-webpack-plugin": "^3.0.0",
"esbuild-loader": "^3.0.0", "esbuild-loader": "^3.0.0",
"eslint": "^8.0.0", "eslint": "^8.0.0",

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
echo "[TEST ALL] test changlog" echo "[TEST ALL] test changelog"
echo "[TEST ALL] test changlog" > ~test-all.txt echo "[TEST ALL] test changelog" > ~test-all.txt
# node ./scripts/check-version-md.js # node ./scripts/check-version-md.js
echo "[TEST ALL] check-commit" echo "[TEST ALL] check-commit"