Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: table 组件 rowSelection 添加 defaultSelectedRowKeys 属性 #29879

Merged
merged 2 commits into from
Mar 25, 2021

Conversation

keelii
Copy link
Contributor

@keelii keelii commented Mar 23, 2021

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

🔗 Related issue link

💡 Background and solution

defaultSelectedRowKeys 属性可以让用户在不触碰 state 的情况下定义 table 组件 rowSelection 中的默认选中行。

📝 Changelog

Language Changelog
🇺🇸 English Table now supports rowSelection.defaultSelectedRowKeys.
🇨🇳 Chinese Table 新增 rowSelection.defaultSelectedRowKeys 支持。

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

@github-actions
Copy link
Contributor

github-actions bot commented Mar 23, 2021

@codecov
Copy link

codecov bot commented Mar 23, 2021

Codecov Report

Merging #29879 (982bd92) into feature (92bc5df) will not change coverage.
The diff coverage is 100.00%.

❗ Current head 982bd92 differs from pull request most recent head 38c9b8a. Consider uploading reports for the commit 38c9b8a to get more accurate results
Impacted file tree graph

@@            Coverage Diff            @@
##           feature    #29879   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          397       397           
  Lines         7510      7509    -1     
  Branches      2112      2101   -11     
=========================================
- Hits          7510      7509    -1     
Impacted Files Coverage Δ
components/_util/wave.tsx 100.00% <100.00%> (ø)
components/config-provider/index.tsx 100.00% <100.00%> (ø)
components/locale/fr_FR.tsx 100.00% <100.00%> (ø)
components/table/hooks/useSelection.tsx 100.00% <100.00%> (ø)
components/tabs/index.tsx 100.00% <100.00%> (ø)
components/transfer/ListItem.tsx 100.00% <100.00%> (ø)
components/transfer/list.tsx 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 92bc5df...38c9b8a. Read the comment docs.

@afc163
Copy link
Member

afc163 commented Mar 23, 2021

来个测试用例。

@keelii
Copy link
Contributor Author

keelii commented Mar 24, 2021

来个测试用例。

如何单独执行某个测试用例?

@yoyo837
Copy link
Contributor

yoyo837 commented Mar 24, 2021

来个测试用例。

如何单独执行某个测试用例?

可以在最后加文件夹路径,只执行某个组件的所有用例。

@afc163
Copy link
Member

afc163 commented Mar 24, 2021

配合 it.only 或者 fit

@keelii
Copy link
Contributor Author

keelii commented Mar 24, 2021

@afc163 已添加。

@afc163 afc163 merged commit 59c3c71 into ant-design:feature Mar 25, 2021
@@ -205,6 +205,7 @@ const columns = [
| preserveSelectedRowKeys | 当数据被删除时仍然保留选项的 `key` | boolean | - | 4.4.0 |
| renderCell | 渲染勾选框,用法与 Column 的 `render` 相同 | function(checked, record, index, originNode) {} | - | 4.1.0 |
| selectedRowKeys | 指定选中项的 key 数组,需要和 onChange 进行配合 | string\[] \| number\[] | \[] | |
| defaultSelectedRowKeys | 默认选中项的 key 数组 | string\[] \| number\[] | \[] | |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

英文文档也需要修改。

@zombieJ zombieJ mentioned this pull request Mar 29, 2021
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants