Skip to content

Commit

Permalink
docs(:sparkles:): release 4.24.16 (#47932)
Browse files Browse the repository at this point in the history
* docs(:sparkles:): release 4.24.16

* chore: upgrade rc-segmented to fix types

* type: fix ref type

* docs: update changelog

* demo: fix Segmented demos
  • Loading branch information
afc163 committed Mar 19, 2024
1 parent 426ae12 commit 7c06024
Show file tree
Hide file tree
Showing 16 changed files with 74 additions and 32 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.en-US.md
Expand Up @@ -15,6 +15,15 @@ timeline: true

---

## 4.24.16

`2024-03-18`

- 🐞 Fix Select that scrollbar is not displayed when there are few options. [#47050](https://github.com/ant-design/ant-design/pull/47050)
- 🐞 Fix Transfer cannot invert current page correctly. [#47134](https://github.com/ant-design/ant-design/pull/47134) [@linxianxi](https://github.com/linxianxi)
- 🐞 Fix that clicking Form tooltip icon should not trigger Switch. [#46159](https://github.com/ant-design/ant-design/pull/46159) [@Wxh16144](https://github.com/Wxh16144)
- 🐞 Fix Segmented `options` className being overrided by `className`. [rc-segmented#175](https://github.com/react-component/segmented/pull/175/) [@stoil-terziev](https://github.com/stoil-terziev)

## 4.24.15

`2023-11-21`
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.zh-CN.md
Expand Up @@ -15,6 +15,15 @@ timeline: true

---

## 4.24.16

`2024-03-18`

- 🐞 修复 Select 组件在选项较少时不显示滚动条的问题。[#47050](https://github.com/ant-design/ant-design/pull/47050)
- 🐞 修复 Transfer 反选当页错误的问题。[#47134](https://github.com/ant-design/ant-design/pull/47134) [@linxianxi](https://github.com/linxianxi)
- 🐞 修复点击 Form `tooltip` 图标会触发 Switch 切换的问题。[#46159](https://github.com/ant-design/ant-design/pull/46159) [@Wxh16144](https://github.com/Wxh16144)
- 🐞 修复 Segmented `options``className` 会覆盖组件自带 `className` 的问题。[rc-segmented#175](https://github.com/react-component/segmented/pull/175/) [@stoil-terziev](https://github.com/stoil-terziev)

## 4.24.15

`2023-11-21`
Expand Down
12 changes: 5 additions & 7 deletions components/_util/wave.tsx
Expand Up @@ -22,7 +22,7 @@ function getValidateContainer(nodeRoot: Node): Element {
}

return Array.from(nodeRoot.childNodes).find(
ele => ele?.nodeType === Node.ELEMENT_NODE,
(ele) => ele?.nodeType === Node.ELEMENT_NODE,
) as Element;
}

Expand Down Expand Up @@ -115,19 +115,17 @@ class Wave extends React.Component<WaveProps> {

styleForPseudo = updateCSS(
`
[${getPrefixCls('')}-click-animating-without-extra-node='true']::after, .${getPrefixCls(
'',
)}-click-animating-node {
[${getPrefixCls('')}-click-animating-without-extra-node='true']::after, .${getPrefixCls('')}-click-animating-node {
--antd-wave-shadow-color: ${waveColor};
}`,
'antd-wave',
{ csp: this.csp, attachTo: nodeBody },
);
) as HTMLStyleElement;
}
if (insertExtraNode) {
node.appendChild(extraNode);
}
['transition', 'animation'].forEach(name => {
['transition', 'animation'].forEach((name) => {
node.addEventListener(`${name}start`, this.onTransitionStart);
node.addEventListener(`${name}end`, this.onTransitionEnd);
});
Expand Down Expand Up @@ -213,7 +211,7 @@ class Wave extends React.Component<WaveProps> {
if (insertExtraNode && this.extraNode && node.contains(this.extraNode)) {
node.removeChild(this.extraNode);
}
['transition', 'animation'].forEach(name => {
['transition', 'animation'].forEach((name) => {
node.removeEventListener(`${name}start`, this.onTransitionStart);
node.removeEventListener(`${name}end`, this.onTransitionEnd);
});
Expand Down
2 changes: 1 addition & 1 deletion components/form/demo/disabled.md
Expand Up @@ -124,5 +124,5 @@ const FormDisabledDemo = () => {
);
};

export default () => <FormDisabledDemo />;
export default FormDisabledDemo;
```
4 changes: 3 additions & 1 deletion components/modal/demo/dark.md
Expand Up @@ -297,7 +297,7 @@ const TableTransfer = ({ leftColumns, rightColumns, ...restProps }) => (
</Transfer>
);

export default () => {
const Demo = () => {
const [open, setOpen] = useState(false);
const [targetKeys, setTargetKeys] = useState(oriTargetKeys);
const [selectedKeys, setSelectedKeys] = useState([]);
Expand Down Expand Up @@ -574,6 +574,8 @@ export default () => {
</>
);
};

export default Demo;
```
<style>
Expand Down
21 changes: 14 additions & 7 deletions components/radio/__tests__/group.test.tsx
@@ -1,11 +1,14 @@
import React from 'react';
import type { RefAttributes } from 'react';
import type { RadioGroupProps } from '..';
import { render, fireEvent } from '../../../tests/utils';
import Radio from '..';

describe('Radio Group', () => {
function createRadioGroup(props?: RadioGroupProps & RefAttributes<HTMLDivElement>) {
function createRadioGroup(
props?: RadioGroupProps & {
ref?: React.Ref<HTMLDivElement> | undefined;
},
) {
return (
<Radio.Group {...props}>
<Radio value="A">A</Radio>
Expand All @@ -15,7 +18,11 @@ describe('Radio Group', () => {
);
}

function createRadioGroupByOption(props?: RadioGroupProps & RefAttributes<HTMLDivElement>) {
function createRadioGroupByOption(
props?: RadioGroupProps & {
ref?: React.Ref<HTMLDivElement> | undefined;
},
) {
const options = [
{ label: 'A', value: 'A' },
{ label: 'B', value: 'B' },
Expand Down Expand Up @@ -68,7 +75,7 @@ describe('Radio Group', () => {

const RadioGroup: React.FC<
RadioGroupProps & { onChangeRadioGroup: RadioGroupProps['onChange'] }
> = props => (
> = (props) => (
<Radio.Group onChange={props.onChangeRadioGroup}>
<Radio value="A" onChange={props.onChange}>
A
Expand Down Expand Up @@ -97,7 +104,7 @@ describe('Radio Group', () => {
it('Trigger onChange when both of radioButton and radioGroup exists', () => {
const onChange = jest.fn();

const RadioGroup: React.FC<RadioGroupProps> = props => (
const RadioGroup: React.FC<RadioGroupProps> = (props) => (
<Radio.Group {...props}>
<Radio.Button value="A">A</Radio.Button>
<Radio.Button value="B">B</Radio.Button>
Expand Down Expand Up @@ -155,7 +162,7 @@ describe('Radio Group', () => {
const GROUP_NAME = 'GROUP_NAME';
const { container } = render(createRadioGroup({ name: GROUP_NAME }));

container.querySelectorAll<HTMLInputElement>('input[type="radio"]').forEach(el => {
container.querySelectorAll<HTMLInputElement>('input[type="radio"]').forEach((el) => {
expect(el.name).toEqual(GROUP_NAME);
});
});
Expand Down Expand Up @@ -230,7 +237,7 @@ describe('Radio Group', () => {
expect(container.querySelectorAll('.ant-radio-wrapper-checked').length).toBe(1);
});

[undefined, null].forEach(newValue => {
[undefined, null].forEach((newValue) => {
it(`should set value back when value change back to ${newValue}`, () => {
const options = [{ label: 'Bamboo', value: 'bamboo' }];
const { container, rerender } = render(<Radio.Group value="bamboo" options={options} />);
Expand Down
11 changes: 7 additions & 4 deletions components/radio/__tests__/radio-button.test.tsx
@@ -1,4 +1,3 @@
import type { RefAttributes } from 'react';
import React from 'react';
import type { RadioGroupProps } from '..';
import Radio, { Button } from '..';
Expand Down Expand Up @@ -36,7 +35,11 @@ describe('Radio Button', () => {
});

describe('Radio Group', () => {
function createRadioGroup(props?: RadioGroupProps & RefAttributes<HTMLDivElement>) {
function createRadioGroup(
props?: RadioGroupProps & {
ref?: React.Ref<HTMLDivElement> | undefined;
},
) {
return (
<Radio.Group {...props}>
<Button value="A">A</Button>
Expand Down Expand Up @@ -154,7 +157,7 @@ describe('Radio Group', () => {
const GROUP_NAME = 'GROUP_NAME';
const { container } = render(createRadioGroup({ name: GROUP_NAME }));

container.querySelectorAll<HTMLInputElement>('input[type="radio"]').forEach(el => {
container.querySelectorAll<HTMLInputElement>('input[type="radio"]').forEach((el) => {
expect(el.name).toEqual(GROUP_NAME);
});
});
Expand Down Expand Up @@ -230,7 +233,7 @@ describe('Radio Group', () => {
expect(container.querySelectorAll('.ant-radio-button-wrapper-checked').length).toBe(1);
});

[undefined, null].forEach(newValue => {
[undefined, null].forEach((newValue) => {
it(`should set value back when value change back to ${newValue}`, () => {
const { container, rerender } = render(
<Radio.Group value="bamboo">
Expand Down
4 changes: 3 additions & 1 deletion components/segmented/demo/basic.md
Expand Up @@ -16,7 +16,9 @@ The most basic usage.
```jsx
import { Segmented } from 'antd';

export default () => <Segmented options={['Daily', 'Weekly', 'Monthly', 'Quarterly', 'Yearly']} />;
const Demo = () => <Segmented options={['Daily', 'Weekly', 'Monthly', 'Quarterly', 'Yearly']} />;

export default Demo;
```

```css
Expand Down
6 changes: 3 additions & 3 deletions components/segmented/demo/block.md
Expand Up @@ -16,7 +16,7 @@ title:
```jsx
import { Segmented } from 'antd';

export default () => (
<Segmented block options={[123, 456, 'longtext-longtext-longtext-longtext']} />
);
const Demo = () => <Segmented block options={[123, 456, 'longtext-longtext-longtext-longtext']} />;

export default Demo;
```
4 changes: 3 additions & 1 deletion components/segmented/demo/custom.md
Expand Up @@ -17,7 +17,7 @@ Custom each Segmented Item by ReactNode.
import { Avatar, Segmented } from 'antd';
import { UserOutlined } from '@ant-design/icons';

export default () => (
const Demo = () => (
<>
<Segmented
options={[
Expand Down Expand Up @@ -93,4 +93,6 @@ export default () => (
/>
</>
);

export default Demo;
```
4 changes: 3 additions & 1 deletion components/segmented/demo/disabled.md
Expand Up @@ -16,7 +16,7 @@ Disabled Segmented.
```jsx
import { Segmented } from 'antd';

export default () => (
const Demo = () => (
<>
<Segmented options={['Map', 'Transit', 'Satellite']} disabled />
<br />
Expand All @@ -31,4 +31,6 @@ export default () => (
/>
</>
);

export default Demo;
```
4 changes: 3 additions & 1 deletion components/segmented/demo/icon-only.md
Expand Up @@ -17,7 +17,7 @@ Set `icon` without `label` for Segmented Item.
import { Segmented } from 'antd';
import { AppstoreOutlined, BarsOutlined } from '@ant-design/icons';

export default () => (
const Demo = () => (
<Segmented
options={[
{
Expand All @@ -31,4 +31,6 @@ export default () => (
]}
/>
);

export default Demo;
```
4 changes: 3 additions & 1 deletion components/segmented/demo/size-consistent.md
Expand Up @@ -17,7 +17,7 @@ Keep consistent height with other components.
```jsx
import { Button, Input, Select, Segmented } from 'antd';

export default () => (
const Demo = () => (
<>
<div>
<Segmented style={{ marginRight: 6 }} size="large" options={['Daily', 'Weekly', 'Monthly']} />
Expand All @@ -37,4 +37,6 @@ export default () => (
</div>
</>
);

export default Demo;
```
4 changes: 3 additions & 1 deletion components/segmented/demo/size.md
Expand Up @@ -16,7 +16,7 @@ There are three sizes of an Segmented: `large` (40px), `default` (32px) and `sma
```jsx
import { Segmented } from 'antd';

export default () => (
const Demo = () => (
<>
<Segmented size="large" options={['Daily', 'Weekly', 'Monthly', 'Quarterly', 'Yearly']} />
<br />
Expand All @@ -25,4 +25,6 @@ export default () => (
<Segmented size="small" options={['Daily', 'Weekly', 'Monthly', 'Quarterly', 'Yearly']} />
</>
);

export default Demo;
```
4 changes: 3 additions & 1 deletion components/segmented/demo/with-icon.md
Expand Up @@ -17,7 +17,7 @@ Set `icon` for Segmented Item.
import { Segmented } from 'antd';
import { AppstoreOutlined, BarsOutlined } from '@ant-design/icons';

export default () => (
const Demo = () => (
<Segmented
options={[
{
Expand All @@ -33,4 +33,6 @@ export default () => (
]}
/>
);

export default Demo;
```
4 changes: 2 additions & 2 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "antd",
"version": "4.24.15",
"version": "4.24.16",
"description": "An enterprise-class UI design language and React components implementation",
"title": "Ant Design",
"keywords": [
Expand Down Expand Up @@ -143,7 +143,7 @@
"rc-progress": "~3.4.2",
"rc-rate": "~2.9.3",
"rc-resize-observer": "^1.3.1",
"rc-segmented": "~2.1.2",
"rc-segmented": "~2.3.0",
"rc-select": "~14.1.18",
"rc-slider": "~10.0.1",
"rc-steps": "~5.0.0",
Expand Down

0 comments on commit 7c06024

Please sign in to comment.