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: Cascader.Panel support #45089
feat: Cascader.Panel support #45089
Conversation
Run & review this pull request in StackBlitz Codeflow. |
New dependencies detected. Learn more about Socket for GitHub ↗︎
|
usePanelStyle(cascaderPrefixCls); | ||
|
||
// ===================== Empty ===================== | ||
const mergedNotFoundContent = notFoundContent || renderEmpty?.('Cascader') || ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这样如果传 null 或者是 false 是不是没办法隐藏 NotFoundContent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
内联空必须要要有个占位,否则会留一个空的框,会很怪异。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
但个人感觉,使用者如果明确传了一个 null 或者是 false 过来,就是明确不想要这个东西,而是想用其他方式提示,既然类型上支持 null 和 false 的话,是不是不应该打破这个规则呢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
false 有需求的话可以支持一下,但是这一版我还是想先坚持一下不做这个处理。
components/cascader/demo/panel.md
Outdated
@@ -0,0 +1,7 @@ | |||
## zh-CN | |||
|
|||
`5.10.0` 新增,适用于一些需要内嵌适用的场景。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不是可以在后面的 <code version="5.10.0">
增加版本角标吗?这里是不是不需要额外加?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
666,我都忘记这个了。
components/cascader/index.en-US.md
Outdated
@@ -36,6 +36,7 @@ Cascade selection box. | |||
<code src="./demo/custom-dropdown.tsx">Custom dropdown</code> | |||
<code src="./demo/placement.tsx">Placement</code> | |||
<code src="./demo/status.tsx">Status</code> | |||
<code src="./demo/panel.tsx">Panel</code> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<code src="./demo/panel.tsx">Panel</code> | |
<code src="./demo/panel.tsx" version="5.10.0">Panel</code> |
components/cascader/index.zh-CN.md
Outdated
@@ -37,6 +37,7 @@ demo: | |||
<code src="./demo/custom-dropdown.tsx">扩展菜单</code> | |||
<code src="./demo/placement.tsx">弹出位置</code> | |||
<code src="./demo/status.tsx">自定义状态</code> | |||
<code src="./demo/panel.tsx">面板使用</code> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<code src="./demo/panel.tsx">面板使用</code> | |
<code src="./demo/panel.tsx" version="5.10.0">面板使用</code> |
size-limit report 📦
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## feature #45089 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 687 693 +6
Lines 11655 11683 +28
Branches 3119 3121 +2
=========================================
+ Hits 11655 11683 +28
☔ View full report in Codecov by Sentry. |
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
💡 Background and solution
📝 Changelog
☑️ Self-Check before Merge
🚀 Summary
🤖 Generated by Copilot at 3a65190
This pull request adds a new
CascaderPanel
component that can be used as a standalone cascader panel for inline view cases. It also refactors the cascader style logic and the checkable logic by using custom hooks and extracting reusable functions. It updates the documentation and the dependency for the cascader component.🔍 Walkthrough
🤖 Generated by Copilot at 3a65190
CascaderPanel
component that provides a standalone cascader panel for inline view cases (link, link, link, link)CascaderPanel
component in both Chinese and English (link, link, link, link)multiple
prop to a custom hookuseCheckable
and reuse it in bothCascader
andCascaderPanel
components (link, link)getColumnsStyle
and reuse it in bothCascader
andCascaderPanel
components (link, link, link, link)prepareComponentToken
that prepares the component token for the cascader style logic and reuse it in the panel style logic (link, link)Cascader
style logic (link, link)rc-cascader
dependency that supports thePanel
component (link)