Skip to content

Commit 787e537

Browse files
author
zhaoge
committed
feat: upgrade antd version to 4.24.16
1 parent c2162b8 commit 787e537

38 files changed

Lines changed: 588 additions & 401 deletions

components/datepicker/demo/light.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ title:
1111
仅暗黑主题下使用,默认主题下使用无效
1212

1313
- 为组件添加类名`dt-form-light-bg`
14-
- 设置组件的属性 `dropdownClassName``dt-form-light-bg`
14+
- 设置组件的属性 `popupClassName``dt-form-light-bg`
1515

1616
```jsx
1717
import { DatePicker } from '../../index';
@@ -22,13 +22,13 @@ const { MonthPicker, RangePicker } = DatePicker;
2222
const dateFormat = 'YYYY-MM-DD';
2323
ReactDOM.render(
2424
<div className="demo-datepicker-light demo-datepicker-box">
25-
<DatePicker className="dt-form-light-bg dt-ant-datepicker-basic" dropdownClassName="dt-form-light-bg" defaultValue={moment('2015-06-06', dateFormat)} />
25+
<DatePicker className="dt-form-light-bg dt-ant-datepicker-basic" popupClassName="dt-form-light-bg" defaultValue={moment('2015-06-06', dateFormat)} />
2626
<br />
27-
<MonthPicker className="dt-form-light-bg dt-ant-datepicker-basic" dropdownClassName="dt-form-light-bg" defaultValue={moment('2015-06', 'YYYY-MM')} />
27+
<MonthPicker className="dt-form-light-bg dt-ant-datepicker-basic" popupClassName="dt-form-light-bg" defaultValue={moment('2015-06', 'YYYY-MM')} />
2828
<br />
2929
<RangePicker
3030
className="dt-form-light-bg dt-ant-datepicker-basic"
31-
dropdownClassName="dt-form-light-bg"
31+
popupClassName="dt-form-light-bg"
3232
defaultValue={[moment('2015-06-06', dateFormat), moment('2015-06-06', dateFormat)]}
3333
/>
3434
</div>,

components/drawer/demo/basic-right.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class App extends React.Component {
6161
title="Small Drawer"
6262
placement="right"
6363
onClose={this.onClose}
64-
visible={this.state.smallVisible}
64+
open={this.state.smallVisible}
6565
>
6666
<p>Some contents...</p>
6767
<p>Some contents...</p>
@@ -72,7 +72,7 @@ class App extends React.Component {
7272
placement="right"
7373
width={1000}
7474
onClose={this.onClose}
75-
visible={this.state.visible}
75+
open={this.state.visible}
7676
>
7777
<p>Some contents...</p>
7878
<p>Some contents...</p>
@@ -83,7 +83,7 @@ class App extends React.Component {
8383
placement="right"
8484
width={1256}
8585
onClose={this.onClose}
86-
visible={this.state.largeVisible}
86+
open={this.state.largeVisible}
8787
>
8888
<p>Some contents...</p>
8989
<p>Some contents...</p>

components/drawer/demo/placement.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class App extends React.Component {
6060
placement={this.state.placement}
6161
closable={false}
6262
onClose={this.onClose}
63-
visible={this.state.visible}
63+
open={this.state.visible}
6464
>
6565
<p>Some contents...</p>
6666
<p>Some contents...</p>

components/dropdown/demo/basic.md

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,29 @@ The most basic dropdown menu.
1616
import { Menu, Dropdown, Space } from 'antd';
1717
import { DownOutlined } from '@ant-design/icons';
1818

19-
const menu = (
20-
<Menu>
21-
<Menu.Item>
22-
<a target="_blank" rel="noopener noreferrer" href="http://www.alipay.com/">
19+
const items = [
20+
{
21+
label: (<a target="_blank" rel="noopener noreferrer" href="http://www.alipay.com/">
2322
1st menu item
24-
</a>
25-
</Menu.Item>
26-
<Menu.Item>
27-
<a target="_blank" rel="noopener noreferrer" href="http://www.taobao.com/">
23+
</a>),
24+
key: '0',
25+
},
26+
{
27+
label: (<a target="_blank" rel="noopener noreferrer" href="http://www.taobao.com/">
2828
2nd menu item
29-
</a>
30-
</Menu.Item>
31-
<Menu.Item>
32-
<a target="_blank" rel="noopener noreferrer" href="http://www.tmall.com/">
29+
</a>),
30+
key: '1',
31+
},
32+
{
33+
label: (<a target="_blank" rel="noopener noreferrer" href="http://www.tmall.com/">
3334
3rd menu item
34-
</a>
35-
</Menu.Item>
36-
</Menu>
37-
);
35+
</a>),
36+
key: '2',
37+
}
38+
];
3839

3940
ReactDOM.render(
40-
<Dropdown overlay={menu}>
41+
<Dropdown menu={{ items }}>
4142
<a onClick={e => e.preventDefault()}>
4243
<Space>
4344
Hover me

components/dropdown/demo/placement.md

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,45 +16,46 @@ Support 6 placements.
1616
```jsx
1717
import { Menu, Dropdown, Button } from 'antd';
1818

19-
const menu = (
20-
<Menu>
21-
<Menu.Item>
22-
<a target="_blank" rel="noopener noreferrer" href="http://www.alipay.com/">
19+
const items = [
20+
{
21+
label: (<a target="_blank" rel="noopener noreferrer" href="http://www.alipay.com/">
2322
1st menu item
24-
</a>
25-
</Menu.Item>
26-
<Menu.Item>
27-
<a target="_blank" rel="noopener noreferrer" href="http://www.taobao.com/">
23+
</a>),
24+
key: '0',
25+
},
26+
{
27+
label: (<a target="_blank" rel="noopener noreferrer" href="http://www.taobao.com/">
2828
2nd menu item
29-
</a>
30-
</Menu.Item>
31-
<Menu.Item>
32-
<a target="_blank" rel="noopener noreferrer" href="http://www.tmall.com/">
29+
</a>),
30+
key: '1',
31+
},
32+
{
33+
label: (<a target="_blank" rel="noopener noreferrer" href="http://www.tmall.com/">
3334
3rd menu item
34-
</a>
35-
</Menu.Item>
36-
</Menu>
37-
);
35+
</a>),
36+
key: '2',
37+
}
38+
];
3839

3940
ReactDOM.render(
4041
<div>
41-
<Dropdown overlay={menu} placement="bottomLeft">
42+
<Dropdown menu={{items}} placement="bottomLeft">
4243
<Button>bottomLeft</Button>
4344
</Dropdown>
44-
<Dropdown overlay={menu} placement="bottomCenter">
45+
<Dropdown menu={{items}} placement="bottomCenter">
4546
<Button>bottomCenter</Button>
4647
</Dropdown>
47-
<Dropdown overlay={menu} placement="bottomRight">
48+
<Dropdown menu={{items}} placement="bottomRight">
4849
<Button>bottomRight</Button>
4950
</Dropdown>
5051
<br />
51-
<Dropdown overlay={menu} placement="topLeft">
52+
<Dropdown menu={{items}} placement="topLeft">
5253
<Button>topLeft</Button>
5354
</Dropdown>
54-
<Dropdown overlay={menu} placement="topCenter">
55+
<Dropdown menu={{items}} placement="topCenter">
5556
<Button>topCenter</Button>
5657
</Dropdown>
57-
<Dropdown overlay={menu} placement="topRight">
58+
<Dropdown menu={{items}} placement="topRight">
5859
<Button>topRight</Button>
5960
</Dropdown>
6061
</div>,

components/empty/demo/light.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@ class Demo extends React.Component {
5959
<ConfigProvider renderEmpty={customize && customizeRenderEmpty}>
6060
<div className="config-provider">
6161
<h3>Select</h3>
62-
<Select dropdownClassName="dt-form-light-bg" className="dt-form-light-bg" style={style} />
62+
<Select popupClassName="dt-form-light-bg" className="dt-form-light-bg" style={style} />
6363

6464
<h3>TreeSelect</h3>
65-
<TreeSelect dropdownClassName="dt-form-light-bg" className="dt-form-light-bg" style={style} treeData={[]} />
65+
<TreeSelect popupClassName="dt-form-light-bg" className="dt-form-light-bg" style={style} treeData={[]} />
6666

6767
<h3>Cascader</h3>
68-
<Cascader dropdownClassName="dt-form-light-bg" className="dt-form-light-bg" style={style} options={[]} placeholder="Please select" />
68+
<Cascader popupClassName="dt-form-light-bg" className="dt-form-light-bg" style={style} options={[]} placeholder="Please select" />
6969
</div>
7070
</ConfigProvider>
7171
</div>

components/form/demo/light.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class NormalLoginForm extends React.Component {
7373
<Input placeholder="Username"/>
7474
</Form.Item>
7575
<Form.Item name="role" colon={false} label={'角色'} rules={[{ required: true, message: 'It is required!' }]}>
76-
<Select dropdownClassName="dt-form-light-bg" placeholder="Please select">
76+
<Select popupClassName="dt-form-light-bg" placeholder="Please select">
7777
<Option value="1">项目所有者</Option>
7878
<Option value="2">数据分析师</Option>
7979
<Option value="3">管理员</Option>
@@ -99,7 +99,7 @@ class NormalLoginForm extends React.Component {
9999
<Switch />
100100
</Form.Item>
101101
<Form.Item name="location" colon={false} label={'位置'} rules={[{ required: false, message: 'It is required!' }]}>
102-
<Cascader dropdownClassName="dt-form-light-bg" options={options} placeholder="Please select" />
102+
<Cascader popupClassName="dt-form-light-bg" options={options} placeholder="Please select" />
103103
</Form.Item>
104104
<Form.Item>
105105
<Button type="primary" htmlType="submit">

components/modal/demo/basic.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class App extends React.Component {
4444
<Modal
4545
title="Basic Modal"
4646
width={640}
47-
visible={this.state.visible}
47+
open={this.state.visible}
4848
onOk={this.handleOk}
4949
onCancel={this.handleCancel}
5050
>

components/modal/demo/containForm.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class App extends React.Component {
7777
<Modal
7878
width={640}
7979
title="Basic Modal"
80-
visible={this.state.visible}
80+
open={this.state.visible}
8181
onOk={this.handleOk}
8282
onCancel={this.handleCancel}
8383
>

components/modal/demo/containTable.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class App extends React.Component {
8484
<Modal
8585
title="Basic Modal"
8686
width={900}
87-
visible={this.state.visible}
87+
open={this.state.visible}
8888
onOk={this.handleOk}
8989
onCancel={this.handleCancel}
9090
>

0 commit comments

Comments
 (0)