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

refactor: cascader use select-input #1074

Merged
merged 10 commits into from
Jul 6, 2022
Merged

refactor: cascader use select-input #1074

merged 10 commits into from
Jul 6, 2022

Conversation

PengYYYYY
Copy link
Collaborator

@PengYYYYY PengYYYYY commented Jun 26, 2022

🤔 这个 PR 的性质是?

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

🔗 相关 Issue

关联PR Tencent/tdesign-common#613

💡 需求背景和解决方案

📝 更新日志

  • refactor(Cascader): 基于 select-input 重构, 文本过长省略使用原生 title 展示全文本,不再使用 tooltip 组件。
  • feat(Cascader): 增加 popupVisible, readonly, selectInputProps, onPopupVisibleChange 属性,具体描述查看文档
  • fix(Cascader): 修复文本过长处理 (issue #907)
  • fix(Cascader): 修复选中内容过多时,再点击选择器后的闪动问题 (issue #949)
  • feat(CheckBox): 增加 title 属性透传
  • fix(SelectInput): 修复 overlayStyle 响应式无法更新
  • fix(TagInput): 修复 inputProps 属性透传无效
  • feat(Dialog): 修复打开对话框,出现滚动条(#1163)

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

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

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

@github-actions
Copy link
Contributor

github-actions bot commented Jun 26, 2022

完成

@codecov-commenter
Copy link

codecov-commenter commented Jun 26, 2022

Codecov Report

Merging #1074 (9ddce8c) into develop (a0db0df) will increase coverage by 1.66%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           develop    #1074      +/-   ##
===========================================
+ Coverage    57.56%   59.22%   +1.66%     
===========================================
  Files          346      403      +57     
  Lines        12828    14896    +2068     
  Branches      2405     2798     +393     
===========================================
+ Hits          7384     8822    +1438     
- Misses        5200     5806     +606     
- Partials       244      268      +24     
Impacted Files Coverage Δ
src/cascader/interface.tsx 0.00% <0.00%> (-100.00%) ⬇️
src/swiper/props.ts 68.75% <0.00%> (-31.25%) ⬇️
src/dialog/props.ts 70.00% <0.00%> (-30.00%) ⬇️
src/calendar/props.ts 70.00% <0.00%> (-30.00%) ⬇️
src/date-picker/props.ts 70.00% <0.00%> (-30.00%) ⬇️
src/drawer/props.ts 71.42% <0.00%> (-28.58%) ⬇️
src/cascader/props.ts 64.28% <0.00%> (-27.39%) ⬇️
src/pagination/props.ts 72.72% <0.00%> (-27.28%) ⬇️
src/affix/affix.tsx 39.06% <0.00%> (-27.01%) ⬇️
src/popup/props.ts 75.00% <0.00%> (-25.00%) ⬇️
... and 231 more

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 5ae6f81...9ddce8c. Read the comment docs.

@uyarn
Copy link
Collaborator

uyarn commented Jul 5, 2022

image

重构后live demo挂了

@uyarn
Copy link
Collaborator

uyarn commented Jul 5, 2022

image

可过滤组件无法输入

src/cascader/index.ts Outdated Show resolved Hide resolved
@chaishi
Copy link
Collaborator

chaishi commented Jul 5, 2022

image

@chaishi
Copy link
Collaborator

chaishi commented Jul 5, 2022

独立 CascaderPanel,方便和其他的触发器组合,如表格的筛选功能不需要输入框

image

@chaishi
Copy link
Collaborator

chaishi commented Jul 5, 2022

image

@chaishi
Copy link
Collaborator

chaishi commented Jul 5, 2022

image

@chaishi
Copy link
Collaborator

chaishi commented Jul 5, 2022

image

@chaishi
Copy link
Collaborator

chaishi commented Jul 5, 2022

image

@chaishi
Copy link
Collaborator

chaishi commented Jul 5, 2022

看着目录结构好多,有点绕,core 和 utils 的区别是什么,我看都是个普通的函数
image

src/cascader/cascader.tsx Outdated Show resolved Hide resolved
src/cascader/cascader.tsx Outdated Show resolved Hide resolved
src/cascader/components/Panel.tsx Show resolved Hide resolved
@PengYYYYY
Copy link
Collaborator Author

image

加载子菜单,不是下拉框

@PengYYYYY
Copy link
Collaborator Author

看着目录结构好多,有点绕,core 和 utils 的区别是什么,我看都是个普通的函数 image

cascader的核心逻辑都放在这个core文件夹里面,vue2,vue3,react通用,就换了个文件夹。分三块整合了一下:和classname相关的逻辑,和用户动作触发的副作用逻辑,还一个工具函数。之前是分组件归类的,换到select-input后,减少了 一个inputContent组件。就统一按现在这样归类了。

@uyarn uyarn merged commit e01748d into develop Jul 6, 2022
@uyarn uyarn deleted the refactor/cascader branch July 6, 2022 07:12
@github-actions github-actions bot mentioned this pull request Jul 11, 2022
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