Skip to content

Conversation

@heiyu4585
Copy link
Contributor

[中文版模板 / Chinese template]

🤔 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

ant-design/ant-design#34193

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English set showCheckedStrategy to 'parent'|'child'' for value type
🇨🇳 Chinese 设置showCheckedStrategy 'parent'|'child'选择返回值方式

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

@vercel
Copy link

vercel bot commented Mar 9, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/react-component/cascader/4RQDxsPZVetpJcKDQGuKXywNBQEX
✅ Preview: https://cascader-git-fork-heiyu4585-fix-showchec-31dc31-react-component.vercel.app

@codecov
Copy link

codecov bot commented Mar 9, 2022

Codecov Report

Merging #255 (fae16df) into master (0107340) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #255   +/-   ##
=======================================
  Coverage   99.79%   99.79%           
=======================================
  Files          15       15           
  Lines         491      495    +4     
  Branches      125      128    +3     
=======================================
+ Hits          490      494    +4     
  Misses          1        1           
Impacted Files Coverage Δ
src/Cascader.tsx 100.00% <100.00%> (ø)
src/utils/commonUtil.ts 100.00% <100.00%> (ø)
src/utils/treeUtil.ts 100.00% <100.00%> (ø)

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 0107340...fae16df. Read the comment docs.

Comment on lines 21 to 23
if (children && children.find(child => child.key && valueSet.has(child.key))) {
return false;
}
Copy link
Member

@MadCcc MadCcc Mar 10, 2022

Choose a reason for hiding this comment

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

感觉可以简化一下,另外用 some 可能比较好?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

src/Cascader.tsx Outdated
export type SingleValueType = (string | number)[];

export type ValueType = SingleValueType | SingleValueType[];
export type ShowCheckedStrategy = 'parent' | 'child';
Copy link
Member

Choose a reason for hiding this comment

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

像 TreeSelect 一样搞个常量?字面量不是很好维护

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@MadCcc MadCcc merged commit 6a3efc9 into react-component:master Mar 10, 2022
@MadCcc
Copy link
Member

MadCcc commented Mar 10, 2022

rc-cascader v3.3.0 发布完了,后续在 antd master 分支上进行吧。

@heiyu4585
Copy link
Contributor Author

rc-cascader v3.3.0 发布完了,后续在 antd master 分支上进行吧。

不需要我做什么操作了吧

@MadCcc
Copy link
Member

MadCcc commented Mar 10, 2022

需要更新下文档和依赖,最好能和 TreeSelect 一样把 strategy 挂在 Cascader 下面

@heiyu4585 heiyu4585 deleted the fix-showCheckedStrategy branch March 11, 2022 02:09
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.

2 participants