diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index 8bf892b1e266..31d146786090 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -15,6 +15,14 @@ timeline: true --- +## 4.20.4 + +`2022-05-11` + +- 🐞 Fix broken List.Item type definition. [#35455](https://github.com/ant-design/ant-design/pull/35455) [@rsmeral](https://github.com/rsmeral) +- 🐞 Fix Checkbox margin in Tree RTL mode. [#35491](https://github.com/ant-design/ant-design/pull/35491) [@miracles1919](https://github.com/miracles1919) +- 🗑 Remove Cascader `displayRender` warning. [#35417](https://github.com/ant-design/ant-design/pull/35417) [@lalalazero](https://github.com/lalalazero) + ## 4.20.3 `2022-05-08` diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index 7279cbd2442e..d4b6b25157d2 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -15,6 +15,14 @@ timeline: true --- +## 4.20.4 + +`2022-05-11` + +- 🐞 修复 List.Item 类型错误。[#35455](https://github.com/ant-design/ant-design/pull/35455) [@rsmeral](https://github.com/rsmeral) +- 🐞 修复 Tree 组件 RTL 模式下 Checkbox 的间距。[#35491](https://github.com/ant-design/ant-design/pull/35491) [@miracles1919](https://github.com/miracles1919) +- 🗑 删除 Cascader `displayRender` 警告。[#35417](https://github.com/ant-design/ant-design/pull/35417) [@lalalazero](https://github.com/lalalazero) + ## 4.20.3 `2022-05-08` diff --git a/components/menu/index.en-US.md b/components/menu/index.en-US.md index 499cda09f048..23a634b96dd3 100644 --- a/components/menu/index.en-US.md +++ b/components/menu/index.en-US.md @@ -29,11 +29,12 @@ ReactDOM.render(=4.20.0 可用,推荐的写法 ✅ const items = [ - { label: '菜单项一' }, - { label: '菜单项二' }, + { label: '菜单项一', key: 'item-1' }, // 菜单项务必填写 key + { label: '菜单项二', key: 'item-2' }, { label: '子菜单', - children: [{ label: '子菜单项' }], + key: 'submenu', + children: [{ label: '子菜单项', key: 'submenu-item-1' }], }, ]; return ; diff --git a/components/table/index.en-US.md b/components/table/index.en-US.md index 0226eab9e71e..d3fee22655e7 100644 --- a/components/table/index.en-US.md +++ b/components/table/index.en-US.md @@ -128,7 +128,6 @@ One of the Table `columns` prop for describing the table's columns, Column has t | defaultFilteredValue | Default filtered values | string\[] | - | | | filterResetToDefaultFilteredValue | click the reset button, whether to restore the default filter | boolean | false | | | defaultSortOrder | Default order of sorted values | `ascend` \| `descend` | - | | -| editable | Whether column can be edited | boolean | false | | | ellipsis | The ellipsis cell content, not working with sorter and filters for now.
tableLayout would be `fixed` when `ellipsis` is `true` or `{ showTitle?: boolean }` | boolean \| {showTitle?: boolean } | false | showTitle: 4.3.0 | | filterDropdown | Customized filter overlay | ReactNode \| (props: [FilterDropdownProps](https://github.com/ant-design/ant-design/blob/ecc54dda839619e921c0ace530408871f0281c2a/components/table/interface.tsx#L79)) => ReactNode | - | | | filterDropdownVisible | Whether `filterDropdown` is visible | boolean | - | | @@ -317,3 +316,7 @@ Table can not tell what state used in `columns.render`, so it always need fully ### How to handle fixed column display over the mask layout? Fixed column use `z-index` to make it over other columns. You will find sometime fixed columns also over your mask layout. You can set `z-index` on your mask layout to resolve. + +### How to custom render Table Checkbox(For example, adding Tooltip)? + +Since `4.1.0`, You can use [`rowSelection.renderCell`](https://ant.design/components/table/#rowSelection) to custom render Table Checkbox. If you want to add Tooltip, please refer to this [demo](https://codesandbox.io/s/table-row-tooltip-v79j2v). diff --git a/components/table/index.zh-CN.md b/components/table/index.zh-CN.md index c3d32cec5d2b..41147c3cb50d 100644 --- a/components/table/index.zh-CN.md +++ b/components/table/index.zh-CN.md @@ -63,7 +63,6 @@ const columns = [ ## API - ### Table | 参数 | 说明 | 类型 | 默认值 | 版本 | @@ -130,7 +129,6 @@ const columns = [ | defaultFilteredValue | 默认筛选值 | string\[] | - | | | filterResetToDefaultFilteredValue | 点击重置按钮的时候,是否恢复默认筛选值 | boolean | false | | | defaultSortOrder | 默认排序顺序 | `ascend` \| `descend` | - | | -| editable | 是否可编辑 | boolean | false | | | ellipsis | 超过宽度将自动省略,暂不支持和排序筛选一起使用。
设置为 `true` 或 `{ showTitle?: boolean }` 时,表格布局将变成 `tableLayout="fixed"`。 | boolean \| { showTitle?: boolean } | false | showTitle: 4.3.0 | | filterDropdown | 可以自定义筛选菜单,此函数只负责渲染图层,需要自行编写各种交互 | ReactNode \| (props: [FilterDropdownProps](https://github.com/ant-design/ant-design/blob/ecc54dda839619e921c0ace530408871f0281c2a/components/table/interface.tsx#L79)) => ReactNode | - | | | filterDropdownVisible | 用于控制自定义筛选菜单是否可见 | boolean | - | | @@ -318,3 +316,7 @@ Table 移除了在 v3 中废弃的 `onRowClick`、`onRowDoubleClick`、`onRowMou ### 固定列穿透到最上层该怎么办? 固定列通过 `z-index` 属性将其悬浮于非固定列之上,这使得有时候你会发现在 Table 上放置遮罩层时固定列会被透过的情况。为遮罩层设置更高的 `z-index` 覆盖住固定列即可。 + +### 如何自定义渲染可选列的勾选框(比如增加 Tooltip)? + +自 `4.1.0` 起,可以通过 [rowSelection](https://ant.design/components/table-cn/#rowSelection) 的 `renderCell` 属性控制,可以参考此处 [Demo](https://codesandbox.io/s/table-row-tooltip-v79j2v) 实现展示 Tooltip 需求或其他自定义的需求。 diff --git a/components/tree/style/rtl.less b/components/tree/style/rtl.less index bc985c956b0e..7604ef60ebdc 100644 --- a/components/tree/style/rtl.less +++ b/components/tree/style/rtl.less @@ -56,7 +56,7 @@ } // >>> Checkbox &-checkbox { - .@{tree-prefix-cls}-rtl& { + .@{tree-prefix-cls}-rtl & { margin: ((@tree-title-height - @checkbox-size) / 2) 0 0 8px; } } diff --git a/package.json b/package.json index 2cbc6691ef13..73dab95a0f10 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "antd", - "version": "4.20.3", + "version": "4.20.4", "description": "An enterprise-class UI design language and React components implementation", "title": "Ant Design", "keywords": [ diff --git a/site/theme/template/Layout/Header/Navigation.tsx b/site/theme/template/Layout/Header/Navigation.tsx index d14366aa627f..16deea435521 100644 --- a/site/theme/template/Layout/Header/Navigation.tsx +++ b/site/theme/template/Layout/Header/Navigation.tsx @@ -129,8 +129,8 @@ export default ({ : null, isZhCN && typeof window !== 'undefined' && - !window.location.host.includes('ant-design.antgroup.com') && - !window.location.host.includes('ant-design.gitee.io') + window.location.host !== 'ant-design.antgroup.com' && + window.location.host !== 'ant-design.gitee.io' ? { label: '国内镜像', key: 'mirror', diff --git a/site/theme/template/Layout/Header/index.tsx b/site/theme/template/Layout/Header/index.tsx index 25f863044db8..ca76c5a77e96 100644 --- a/site/theme/template/Layout/Header/index.tsx +++ b/site/theme/template/Layout/Header/index.tsx @@ -121,7 +121,7 @@ class Header extends React.Component { }); if ( process.env.NODE_ENV === 'production' && - !window.location.host.includes('ant-design.antgroup.com') && + window.location.host !== 'ant-design.antgroup.com' && shouldOpenAntdMirrorModal() ) { Modal.confirm({