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 filterMode and filterSearch functions #31809

Merged
merged 38 commits into from
Sep 1, 2021

Conversation

afc163
Copy link
Member

@afc163 afc163 commented Aug 16, 2021

[中文版模板 / Chinese template]

🤔 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

close #30654

💡 Background and solution

Preview url: https://preview-31809-ant-design.surge.sh/components/table-cn/#components-table-demo-filter-in-tree

  • filterMode: 'tree'

图片

  • filterSearch: true

图片

📝 Changelog

Language Changelog
🇺🇸 English - Table adds column.filterMode to support filter in a tree, which could set to 'menu' | 'tree'.
- Table adds column.filterSearch for enable search function in filter dropdown.
- Table filter reset button won't close dropdown now.
- Tweak Transfer filter search input icon position.
🇨🇳 Chinese - Table 新增 column.filterMode 以支持配置树形筛选菜单,可选值为 'menu' | 'tree'
- Table 新增 column.filterSearch 以支持开启筛选列搜索功能。
- Table 筛选菜单重置按钮现在不再关闭菜单和生效。
- 调整 Transfer 筛选搜索框图标位置,使其和表格筛选搜索框统一。

☑️ 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 Aug 16, 2021

@afc163 afc163 force-pushed the feat-table-filter-tree branch from ef5f232 to dc97a52 Compare August 17, 2021 10:30
@afc163 afc163 changed the title feat: Table filterMode feat: Table filterMode and filterSearch functions Aug 17, 2021
@codecov
Copy link

codecov bot commented Aug 17, 2021

Codecov Report

Merging #31809 (d58eae3) into feature (a43e21e) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##           feature   #31809   +/-   ##
========================================
  Coverage    99.95%   99.96%           
========================================
  Files          409      410    +1     
  Lines         7461     7503   +42     
  Branches      2032     2049   +17     
========================================
+ Hits          7458     7500   +42     
  Misses           3        3           
Impacted Files Coverage Δ
components/locale/default.tsx 100.00% <ø> (ø)
components/locale/zh_CN.tsx 100.00% <ø> (ø)
components/input/Input.tsx 100.00% <100.00%> (ø)
...omponents/table/hooks/useFilter/FilterDropdown.tsx 100.00% <100.00%> (ø)
components/table/hooks/useFilter/FilterSearch.tsx 100.00% <100.00%> (ø)
components/table/hooks/useFilter/index.tsx 100.00% <100.00%> (ø)
components/transfer/search.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 a43e21e...d58eae3. Read the comment docs.

@afc163 afc163 marked this pull request as ready for review August 19, 2021 10:00
@afc163
Copy link
Member Author

afc163 commented Aug 19, 2021

  • filterMultiple 支持
  • select 父节点时,key 里面只有一个。需要把这个测试用例跑通:73a578f

搞定,如此简单!f37a517

@afc163
Copy link
Member Author

afc163 commented Aug 26, 2021

谁来 review 一下,给个 approve

@kerm1it
Copy link
Member

kerm1it commented Aug 26, 2021

提交太多了,没法review😄,直接给 approve?

@hengkx
Copy link
Member

hengkx commented Aug 26, 2021

是的太多了,我看Input 里面也有新增加属性 为什么没有拆分出来, 还有htmlSize感觉怪怪的

@afc163
Copy link
Member Author

afc163 commented Aug 26, 2021

是的太多了,我看Input 里面也有新增加属性 为什么没有拆分出来, 还有htmlSize感觉怪怪的

htmlSize 是解决 Input 最小宽度的问题。不修改的话 Table 筛选菜单里的搜索框最小宽度就太大了。

@hengkx
Copy link
Member

hengkx commented Aug 26, 2021

是的太多了,我看Input 里面也有新增加属性 为什么没有拆分出来, 还有htmlSize感觉怪怪的

htmlSize 是解决 Input 最小宽度的问题。不修改的话 Table 筛选菜单里的搜索框最小宽度就太大了。

style width minWidth不能用吗?

@kerm1it
Copy link
Member

kerm1it commented Aug 26, 2021

image

这个是正常的么?

@xrkffgg
Copy link
Member

xrkffgg commented Aug 26, 2021

rtl 样式有点问题,不过不着急,回头我单改就行

@afc163
Copy link
Member Author

afc163 commented Aug 27, 2021

@kerm1it 正常,Transfer 的搜索框样式也统一掉了,所有有结构变化。

@afc163 afc163 force-pushed the feat-table-filter-tree branch from 6dae4a7 to 06a6823 Compare August 31, 2021 14:46
@github-actions
Copy link
Contributor

Size Change: +2.23 kB (0%)

Total Size: 844 kB

Filename Size Change
./dist/antd-with-locales.min.js 348 kB +987 B (0%)
./dist/antd.compact.min.css 64.8 kB +87 B (0%)
./dist/antd.dark.min.css 66.1 kB +87 B (0%)
./dist/antd.min.css 65 kB +87 B (0%)
./dist/antd.min.js 300 kB +986 B (0%)

compressed-size-action

.antd-tools.config.js Outdated Show resolved Hide resolved
.antd-tools.config.js Outdated Show resolved Hide resolved
@Veveue
Copy link
Contributor

Veveue commented Feb 22, 2022

筛选菜单重置按钮现在不再关闭菜单和生效。 这个有没有开关 @afc163

@Simoon-F
Copy link

filterMode: 'tree' 的搜索可以过滤可以和 menu 一样,只展示符合条件的吗?或者说有什么比较好的方案实现?

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.

7 participants