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

Filter Icon of Table #5293

Merged
merged 5 commits into from
Mar 27, 2017
Merged

Filter Icon of Table #5293

merged 5 commits into from
Mar 27, 2017

Conversation

RaoHai
Copy link
Contributor

@RaoHai RaoHai commented Mar 14, 2017

@mention-bot
Copy link

@RaoHai, thanks for your PR! By analyzing the history of the files in this pull request, we identified @afc163, @benjycui and @yesmeck to be potential reviewers.

@afc163
Copy link
Member

afc163 commented Mar 14, 2017

  1. should be put inside column object, for different column file icons.
  2. isFiltered => filtered, match with filteredValue.
  3. PR to feature-2.9, it is a new feature.
<Table columns={[{ filtered: true }]} />

@RaoHai RaoHai changed the base branch from master to feature-2.9 March 14, 2017 07:02
@RaoHai
Copy link
Contributor Author

RaoHai commented Mar 14, 2017

done

@codecov
Copy link

codecov bot commented Mar 14, 2017

Codecov Report

Merging #5293 into feature-2.9 will increase coverage by 0.01%.
The diff coverage is 100%.

@@               Coverage Diff               @@
##           feature-2.9    #5293      +/-   ##
===============================================
+ Coverage        86.11%   86.12%   +0.01%     
===============================================
  Files              174      174              
  Lines             4444     4448       +4     
  Branches          1288     1289       +1     
===============================================
+ Hits              3827     3831       +4     
  Misses             617      617
Impacted Files Coverage Δ
components/table/Column.tsx 100% <ø> (ø) ⬆️
components/table/filterDropdown.tsx 95.69% <100%> (+0.19%) ⬆️

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 b054a0c...398284d. Read the comment docs.

@@ -43,6 +43,7 @@ class App extends React.Component {
filterDropdownVisible: false,
data,
searchText: '',
isFiltered: false,
Copy link
Member

Choose a reason for hiding this comment

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

filtered

@@ -94,6 +94,7 @@ const columns = [{
| filterDropdownVisible | 用于控制自定义筛选菜单是否可见 | boolean | - |
| onFilterDropdownVisibleChange | 自定义筛选菜单可见变化时调用 | function(visible) {} | - |
| filteredValue | 筛选的受控属性,外界可用此控制列的筛选状态,值为已筛选的 value 数组 | string[] | - |
| filtered | 标识数据是否经过过滤 | boolean | false |
Copy link
Member

Choose a reason for hiding this comment

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

加一句『筛选图标会高亮』

@@ -209,7 +210,7 @@ export default class FilterMenu extends React.Component<FilterMenuProps, any> {
</FilterDropdownMenuWrapper>
);

const dropdownSelectedClass = (this.props.selectedKeys.length > 0)
const dropdownSelectedClass = (this.props.selectedKeys.length > 0 || this.props.filtered)
Copy link
Member

Choose a reason for hiding this comment

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

如果有 filtered,则只看 filtered 吧。

@afc163
Copy link
Member

afc163 commented Mar 14, 2017

想了下,不如把 filtered 改为 filterIcon,用户自行负责这个图标的渲染即可,也同时满足自定义图标的需求。

@afc163
Copy link
Member

afc163 commented Mar 20, 2017

rebase

+ close ant-design#5287
+ add `isFiltered` props for mark dataSource is filterd
+ improve CustomFilter Demo
@afc163 afc163 merged commit 15e6133 into ant-design:feature-2.9 Mar 27, 2017
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.

None yet

3 participants