Skip to content

feat(cascader): add popupHeader and popupFooter slot#6297

Open
RSS1102 wants to merge 17 commits intodevelopfrom
rss1102/feat/cascader/panel-header
Open

feat(cascader): add popupHeader and popupFooter slot#6297
RSS1102 wants to merge 17 commits intodevelopfrom
rss1102/feat/cascader/panel-header

Conversation

@RSS1102
Copy link
Collaborator

@RSS1102 RSS1102 commented Dec 29, 2025

🤔 这个 PR 的性质是?

  • 日常 bug 修复
  • 新特性提交
  • 文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • CI/CD 改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他

🔗 相关 Issue

💡 需求背景和解决方案

Cascader Panel 搜索功能

基础搜索

每级面板独立过滤,互不影响。

级联搜索

操作 行为
搜索 隐藏后续面板,只显示匹配项
展开节点 显示子级面板(仅限匹配路径)
清空搜索 已展开面板保持显示
全部清空 还原初始状态
无匹配 面板保留,内容为空

约束:展开方式由 trigger(click/hover)决定,不可展开非匹配节点的子级。

📝 更新日志

  • 本条 PR 不需要纳入 Changelog

tdesign-vue-next

@tdesign-vue-next/chat

@tdesign-vue-next/auto-import-resolver

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供

@tdesign-bot
Copy link
Collaborator

tdesign-bot commented Dec 29, 2025

TDesign Component Site Preview Open

Component Preview
tdesign-vue-next 完成
@tdesign-vue-next/chat 完成

@RSS1102 RSS1102 marked this pull request as draft December 29, 2025 02:29
@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 29, 2025

  • tdesign-vue-next-demo

    npm i https://pkg.pr.new/Tencent/tdesign-vue-next/@tdesign-vue-next/auto-import-resolver@6297
    
    npm i https://pkg.pr.new/Tencent/tdesign-vue-next@6297
    
    npm i https://pkg.pr.new/Tencent/tdesign-vue-next/@tdesign-vue-next/chat@6297
    

commit: 61a4b53

@uyarn uyarn added the 🏃 in progress someone is developing label Dec 31, 2025
@RSS1102 RSS1102 force-pushed the rss1102/feat/cascader/panel-header branch 2 times, most recently from 1420255 to 096acca Compare January 26, 2026 08:42
@RSS1102 RSS1102 force-pushed the rss1102/feat/cascader/panel-header branch from 096acca to 2e85fa6 Compare January 26, 2026 09:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds panelHeader and panelFooter slot support to the Cascader component, enabling per-panel filtering/search functionality with both basic and cascade modes. Basic mode filters each panel independently, while cascade mode hides subsequent panels when searching and only shows children of matched items.

Changes:

  • Added panelHeader and panelFooter TNode type definitions with onFilter callback support
  • Implemented panel-level filtering state management with cascade mode support
  • Modified Panel component to render header/footer slots and handle filtering logic
  • Replaced base example to demonstrate the new filtering functionality

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
packages/components/cascader/type.ts Added TypeScript type definitions for panelHeader and panelFooter slots with onFilter callback supporting both string and function filters
packages/components/cascader/props.ts Added prop definitions for panelHeader and panelFooter
packages/components/cascader/components/Panel.tsx Implemented filtering logic, state management, and slot rendering for panel headers/footers
packages/components/cascader/cascader.tsx Passed panelHeader and panelFooter slots to Panel component
packages/components/cascader/_example/base.vue Replaced original base example with comprehensive filtering demonstrations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Wesley-0808 Wesley-0808 requested a review from Copilot January 30, 2026 07:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 18 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +144 to +147
onFilter: (
filter: string | ((node: CascaderOption, panelIndex: number) => boolean),
options?: { cascade?: boolean },
) => void;
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

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

The type definition references TreeOptionData in the onFilter callback parameters but the import shows TreeOptionData comes from @tdesign/common-js/common. However, in the type definition (line 145, 165), the parameter is documented as filtering nodes, but CascaderOption which extends TreeOptionData is what's actually used throughout the cascader. This could cause type confusion. Consider using CascaderOption explicitly or clarifying that it's the same as TreeOptionData.

Copilot uses AI. Check for mistakes.
@RSS1102 RSS1102 changed the title feat(cascader): add panelHeader and panelFooter slot feat(cascader): add popupHeader and popupFooter slot Jan 30, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@uyarn uyarn marked this pull request as ready for review February 1, 2026 16:19
@uyarn uyarn removed the 🏃 in progress someone is developing label Feb 1, 2026
@uyarn
Copy link
Collaborator

uyarn commented Feb 3, 2026

API 命名还是不太好 popupXX 不太能表达这个位置的感觉 甚至比panelTopContent/BottomContent更外层的感觉

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.

4 participants