Browse Source

chore: auto merge branches (#36258)

chore: merge master into next
pull/36259/head
github-actions[bot] 2 years ago
committed by GitHub
parent
commit
17cc8dddda
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 21
      CHANGELOG.en-US.md
  2. 21
      CHANGELOG.zh-CN.md
  3. 55
      components/_util/__tests__/util.test.js
  4. 51
      components/_util/__tests__/wave.test.js
  5. 9
      components/_util/wave.tsx
  6. 2
      components/config-provider/__tests__/index.test.js
  7. 3
      components/switch/__tests__/wave.test.js
  8. 6
      package.json

21
CHANGELOG.en-US.md

@ -14,6 +14,27 @@ timeline: true
- Major version release is not included in this schedule for breaking change and new features.
---
## 4.21.4
`2022-06-27`
- Table
- 🐞 Fix Table expand icon not align center. [#36215](https://github.com/ant-design/ant-design/pull/36215)
- 💄 Fix nested Table margin style. [#36209](https://github.com/ant-design/ant-design/pull/36209)
- 🐞 Fix Table filter dropdown with multiple subMenu may not closed. [#36132](https://github.com/ant-design/ant-design/pull/36132)
- 🐞 Table reset the last selection key when deselect or bulk operations. [#34705](https://github.com/ant-design/ant-design/pull/34705) [@Dunqing](https://github.com/Dunqing)
- 🐞 Fix Popover arrow color with custom `color` prop. [#36241](https://github.com/ant-design/ant-design/pull/36241) [@MadCcc](https://github.com/MadCcc)
- 🐞 Fix Upload `listType="picture-card"` select button not being hidden when children is empty. [#36196](https://github.com/ant-design/ant-design/pull/36196)
- 🐞 Fix Menu deprecated warning when `item={undefined}`. [#36190](https://github.com/ant-design/ant-design/pull/36190)
- 💄 Fix Button `loading` icon margin style lost. [#36168](https://github.com/ant-design/ant-design/pull/36168)
- 🐞 Fix Dropdown using Menu with group item can not close by click. [#36148](https://github.com/ant-design/ant-design/pull/36148)
- 💄 Enlarge dragable area for Slider handler. [#36018](https://github.com/ant-design/ant-design/pull/36018) [@slotDumpling](https://github.com/slotDumpling)
- 🐞 Fix: repeat a css class in readOnly, which has been declared in rc-input-number. [#36120](https://github.com/ant-design/ant-design/pull/36120) [@RainyLiao](https://github.com/RainyLiao)
- 💄 Fix Skeleton active background color in dark theme. [#36116](https://github.com/ant-design/ant-design/pull/36116)
- TypeScript
- 🤖 Fix type incompatibility. [#36189](https://github.com/ant-design/ant-design/pull/36189) [@Dunqing](https://github.com/Dunqing)
- 🤖 exporting `UploadFile` from `Upload`. [#34733](https://github.com/ant-design/ant-design/pull/34733) [@chentsulin](https://github.com/chentsulin)
## 4.21.3

21
CHANGELOG.zh-CN.md

@ -15,6 +15,27 @@ timeline: true
---
## 4.21.4
`2022-06-27`
- Table
- 🐞 修复 Table 展开图标未居中的问题。[#36215](https://github.com/ant-design/ant-design/pull/36215)
- 💄 修复 Table 内嵌 Table 时的边距问题。[#36209](https://github.com/ant-design/ant-design/pull/36209)
- 🐞 Table 取消选择或批量操作时重置上一次选择的 key。[#34705](https://github.com/ant-design/ant-design/pull/34705) [@Dunqing](https://github.com/Dunqing)
- 🐞 修复 Table 过滤列表在某些场景下多级展开无法关闭的问题。[#36132](https://github.com/ant-design/ant-design/pull/36132)
- 🐞 修复 Upload `listType="picture-card"` 当 children 为空时上传文件按钮没有隐藏的问题。[#36196](https://github.com/ant-design/ant-design/pull/36196)
- 🐞 修复 Popover 自定义 `color` 时箭头颜色问题。[#36241](https://github.com/ant-design/ant-design/pull/36241) [@MadCcc](https://github.com/MadCcc)
- 🐞 修复 Menu `item={undefined}` 时会有废弃警告的问题。[#36190](https://github.com/ant-design/ant-design/pull/36190)
- 💄 修复 Button `loading` 图标的间距丢失的问题。[#36168](https://github.com/ant-design/ant-design/pull/36168)
- 🐞 修复 Dropdown 中 Menu 分组下的 Item 点击不会关闭的问题。[#36148](https://github.com/ant-design/ant-design/pull/36148)
- 💄 优化 Slider 拖拽手柄的可交互区域。[#36018](https://github.com/ant-design/ant-design/pull/36018) [@slotDumpling](https://github.com/slotDumpling)
- 🐞 修复重复添加 readOnly 的 css 类名,它已在 rc-input-number 中被声明了。[#36120](https://github.com/ant-design/ant-design/pull/36120) [@RainyLiao](https://github.com/RainyLiao)
- 💄 修复 Skeleton 在 `active` 时的背景色样式。[#36116](https://github.com/ant-design/ant-design/pull/36116)
- TypeScript
- 🤖 修复 TreeSelect `switcherIcon` 类型不兼容。[#36189](https://github.com/ant-design/ant-design/pull/36189) [@Dunqing](https://github.com/Dunqing)
- 🤖 从 `Upload` 导出类型 `UploadFile`。[#34733](https://github.com/ant-design/ant-design/pull/34733) [@chentsulin](https://github.com/chentsulin)
## 4.21.3
`2022-06-17`

55
components/_util/__tests__/util.test.js

@ -12,7 +12,6 @@ import {
throttleByAnimationFrameDecorator,
} from '../throttleByAnimationFrame';
import TransButton from '../transButton';
import Wave from '../wave';
describe('Test utils function', () => {
describe('throttle', () => {
@ -140,60 +139,6 @@ describe('Test utils function', () => {
});
});
describe('wave', () => {
it('bindAnimationEvent should return when node is null', () => {
const wrapper = mount(
<Wave>
<button type="button" disabled>
button
</button>
</Wave>,
)
.find(Wave)
.instance();
expect(wrapper.bindAnimationEvent()).toBe(undefined);
});
it('bindAnimationEvent.onClick should return when children is hidden', () => {
const wrapper = mount(
<Wave>
<button type="button" style={{ display: 'none' }}>
button
</button>
</Wave>,
)
.find(Wave)
.instance();
expect(wrapper.bindAnimationEvent()).toBe(undefined);
});
it('bindAnimationEvent.onClick should return when children is input', () => {
const wrapper = mount(
<Wave>
<input />
</Wave>,
)
.find(Wave)
.instance();
expect(wrapper.bindAnimationEvent()).toBe(undefined);
});
it('should not throw when click it', () => {
expect(() => {
const wrapper = mount(
<Wave>
<div />
</Wave>,
);
wrapper.simulate('click');
}).not.toThrow();
});
it('should not throw when no children', () => {
expect(() => mount(<Wave />)).not.toThrow();
});
});
describe('TransButton', () => {
it('can be focus/blur', () => {
const ref = React.createRef();

51
components/_util/__tests__/wave.test.js

@ -1,7 +1,7 @@
import { mount } from 'enzyme';
import React from 'react';
import mountTest from '../../../tests/shared/mountTest';
import { sleep } from '../../../tests/utils';
import { render, sleep } from '../../../tests/utils';
import ConfigProvider from '../../config-provider';
import Wave from '../wave';
@ -148,4 +148,53 @@ describe('Wave component', () => {
expect(styles[0].getAttribute('nonce')).toBe('YourNonceCode');
wrapper.unmount();
});
it('bindAnimationEvent should return when node is null', () => {
const ref = React.createRef();
render(
<Wave ref={ref}>
<button type="button" disabled>
button
</button>
</Wave>,
);
expect(ref.current?.bindAnimationEvent()).toBe(undefined);
});
it('bindAnimationEvent.onClick should return when children is hidden', () => {
const ref = React.createRef();
render(
<Wave ref={ref}>
<button type="button" style={{ display: 'none' }}>
button
</button>
</Wave>,
);
expect(ref.current?.bindAnimationEvent()).toBe(undefined);
});
it('bindAnimationEvent.onClick should return when children is input', () => {
const ref = React.createRef();
render(
<Wave ref={ref}>
<input />
</Wave>,
);
expect(ref.current?.bindAnimationEvent()).toBe(undefined);
});
it('should not throw when click it', () => {
expect(() => {
const wrapper = mount(
<Wave>
<div />
</Wave>,
);
wrapper.simulate('click');
}).not.toThrow();
});
it('should not throw when no children', () => {
expect(() => mount(<Wave />)).not.toThrow();
});
});

9
components/_util/wave.tsx

@ -1,6 +1,7 @@
import { updateCSS } from 'rc-util/lib/Dom/dynamicCSS';
import { composeRef, supportRef } from 'rc-util/lib/ref';
import * as React from 'react';
import { forwardRef } from 'react';
import type { ConfigConsumerProps, CSPConfig } from '../config-provider';
import { ConfigConsumer, ConfigContext } from '../config-provider';
import raf from './raf';
@ -31,7 +32,7 @@ export interface WaveProps {
children?: React.ReactNode;
}
export default class Wave extends React.Component<WaveProps> {
class InternalWave extends React.Component<WaveProps> {
static contextType = ConfigContext;
private instance?: {
@ -226,3 +227,9 @@ export default class Wave extends React.Component<WaveProps> {
return <ConfigConsumer>{this.renderWave}</ConfigConsumer>;
}
}
const Wave = forwardRef<InternalWave, WaveProps>((props, ref) => (
<InternalWave ref={ref} {...props} />
));
export default Wave;

2
components/config-provider/__tests__/index.test.js

@ -23,7 +23,7 @@ describe('ConfigProvider', () => {
</ConfigProvider>,
);
expect(wrapper.find('Wave').instance().csp).toBe(csp);
expect(wrapper.find('InternalWave').instance().csp).toBe(csp);
});
it('autoInsertSpaceInButton', () => {

3
components/switch/__tests__/wave.test.js

@ -2,7 +2,6 @@ import { mount } from 'enzyme';
import React from 'react';
import Switch from '..';
import { sleep } from '../../../tests/utils';
import Wave from '../../_util/wave';
describe('click wave effect', () => {
async function click(wrapper) {
@ -16,7 +15,7 @@ describe('click wave effect', () => {
it('should have click wave effect', async () => {
const wrapper = mount(<Switch />);
await click(wrapper);
const waveInstance = wrapper.find(Wave).instance();
const waveInstance = wrapper.find('InternalWave').instance();
const resetEffect = jest.spyOn(waveInstance, 'resetEffect');
await click(wrapper);
expect(resetEffect).toHaveBeenCalledTimes(1);

6
package.json

@ -1,6 +1,6 @@
{
"name": "antd",
"version": "4.21.3",
"version": "4.21.4",
"description": "An enterprise-class UI design language and React components implementation",
"title": "Ant Design",
"keywords": [
@ -201,7 +201,7 @@
"bisheng-plugin-toc": "^0.4.4",
"bundlesize": "^0.18.0",
"chalk": "^4.0.0",
"cheerio": "1.0.0-rc.10",
"cheerio": "1.0.0-rc.12",
"concurrently": "^7.0.0",
"cross-env": "^7.0.0",
"css-minimizer-webpack-plugin": "^1.3.0",
@ -236,7 +236,7 @@
"identity-obj-proxy": "^3.0.0",
"immer": "^9.0.1",
"immutability-helper": "^3.0.0",
"inquirer": "^9.0.0",
"inquirer": "^8.0.0",
"intersection-observer": "^0.12.0",
"isomorphic-fetch": "^3.0.0",
"jest": "^28.0.3",

Loading…
Cancel
Save