Skip to content

feat: add icon to collapsible - #37566

Merged
afc163 merged 10 commits into
ant-design:featurefrom
MattinaYang:feat/collapse
Sep 20, 2022
Merged

afc163 merged 10 commits into
ant-design:featurefrom
MattinaYang:feat/collapse

Conversation

@MattinaYang

@MattinaYang MattinaYang commented Sep 15, 2022 •

Copy link
Copy Markdown
Contributor

🤔 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

react-component/collapse#232
close #37379

💡 Background and solution

I added 'icon' to rc-collapse's 'collapsible' segment several monthes ago, and the pr had been merged two days ago, since version 3.4.0 was released. So I wanna add this to antd Collapse too.

📝 Changelog

Add choice 'icon' to 'collapsible', which could only be 'header' or 'disabled' for now.

Language Changelog
🇺🇸 English Collapse supports collapsible="icon" to collapse by clicking icon.
🇨🇳 Chinese Collapse 新增 collapsible="icon" 从而支持点击图标展开收起。

☑️ 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

github-actions Bot commented Sep 15, 2022 •

Copy link
Copy Markdown
Contributor

@MattinaYang MattinaYang mentioned this pull request Sep 15, 2022
4 of 19 tasks
@afc163 afc163 changed the title Feat/collapse feat: add icon to collapsible Sep 16, 2022
@afc163

afc163 commented Sep 16, 2022 •

Copy link
Copy Markdown
Member

#37419 (comment) 问题没解,这个需要改 rc-collapse

@MattinaYang

Copy link
Copy Markdown
Contributor Author

#37419 (comment) 问题没解,这个需要改 rc-collapse

这个问题在 feature 分支(rc-collapse为3.3.0版本)就出现了,似乎不是添加‘icon’选项带来的? 👀

@afc163

afc163 commented Sep 17, 2022

Copy link
Copy Markdown
Member

react-component/collapse#238 这里引入的,3.4.0 里的问题。

@afc163

afc163 commented Sep 17, 2022

Copy link
Copy Markdown
Member

我来修掉。react-component/collapse#240

Comment thread package.json Resolved
@afc163

afc163 commented Sep 17, 2022

Copy link
Copy Markdown
Member

现在出现了一个新的问题,@Sheepeer 看看

https://github.com/ant-design/ant-design/actions/runs/3072589779/jobs/4964204830

<Panel header="This panel can only be collapsed by clicking icon" key="1">
<p>{text}</p>
</Panel>
</Collapse>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

这里需要更新一下 jest snapshot。

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

已更新

@codecov

codecov Bot commented Sep 19, 2022 •

Copy link
Copy Markdown

Codecov Report

Merging #37566 (c59a15a) into feature (91821d4) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##           feature    #37566   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          444       444           
  Lines         8205      8205           
  Branches      2415      2415           
=========================================
  Hits          8205      8205           
Impacted Files Coverage Δ
components/collapse/CollapsePanel.tsx 100.00% <ø> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

| activeKey | 当前激活 tab 面板的 key | string\[] \| string <br/> number\[] \| number | 默认无,accordion 模式下默认第一个元素 | |
| bordered | 带边框风格的折叠面板 | boolean | true | |
| collapsible | 所有子面板是否可折叠或指定可折叠触发区域 | `header` \| `disabled` | - | 4.9.0 |
| collapsible | 所有子面板是否可折叠或指定可折叠触发区域 | `header` \| `icon` \| `disabled` | - | 4.9.0 |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

后面的版本要标记一下,icon 在 4.24.0 支持

Comment thread components/collapse/index.en-US.md Outdated
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| collapsible | Specify whether the panel be collapsible or the trigger area of collapsible | `header` \| `icon` \| `disabled` | - | 4.9.0 |
| collapsible | Specify whether the panel be collapsible or the trigger area of collapsible | `header` \| `icon` \| `disabled` | - | 4.24.0 |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@afc163

afc163 commented Sep 20, 2022

Copy link
Copy Markdown
Member

图片

有点问题,尝试重装本地 node_modules 以后再跑 npm test -- components/collapse

@MattinaYang

Copy link
Copy Markdown
Contributor Author
图片

有点问题,尝试重装本地 node_modules 以后再跑 npm test -- components/collapse

ohhhhhhh真的是依赖的问题 谢谢!!!

@afc163
afc163 merged commit 0054ff9 into ant-design:feature Sep 20, 2022
@afc163

afc163 commented Sep 20, 2022

Copy link
Copy Markdown
Member

图片

@zombieJ 这个 PR 貌似不会上传 argo-ci

@zombieJ

zombieJ commented Sep 22, 2022

Copy link
Copy Markdown
Member
图片

@zombieJ 这个 PR 貌似不会上传 argo-ci

workflow run 不知道为什么拿不到 archive 了,这个之前尝试找了一下还是不行。暂时没有头绪。

@MadCcc MadCcc mentioned this pull request Oct 11, 2022
19 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