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

feat: menu support z-index manager #45498

Merged
merged 16 commits into from Oct 24, 2023
Merged

Conversation

kiner-tang
Copy link
Member

@kiner-tang kiner-tang commented Oct 23, 2023

[中文版模板 / 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
  • Workflow
  • Other (about what?)

🔗 Related issue link

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English Menu Support z-index context to manage z-index
🇨🇳 Chinese Menu 支持通过 z-index 上下文管理 z-index

☑️ Self-Check before Merge

⚠️ Please check all items below before requesting a reviewing. ⚠️

  • 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

🚀 Summary

🤖 Generated by Copilot at 2110df8

This pull request adds or updates a useZIndex hook to several components that have popup or dropdown elements. The hook controls the zIndex style of the components based on their type and optional props. This improves the positioning and visibility of the components in different scenarios. The pull request also refactors some test and import code for better readability and reliability.

🔍 Walkthrough

🤖 Generated by Copilot at 2110df8

  • Added the useZIndex hook to assign and apply zIndex values to various components that have popup or dropdown elements, such as AutoComplete, Cascader, ColorPicker, DatePicker, Menu, and TreeSelect (link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link)
  • Refactored the test case for the useZIndex hook in useZIndex.test.tsx to enable testing all the possible consumer components, account for the special case of the Tour component, and prevent timeout errors (link, link, link, link, link)
  • Reordered the import statements in SubMenu.tsx to follow the convention of importing React first, then external modules, then internal modules (link)

@stackblitz
Copy link

stackblitz bot commented Oct 23, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 23, 2023

Preview Is ready

@github-actions
Copy link
Contributor

github-actions bot commented Oct 23, 2023

size-limit report 📦

Path Size
./dist/antd.min.js 399.68 KB (+2 B 🔺)
./dist/antd-with-locales.min.js 458.99 KB (+5 B 🔺)

@codecov
Copy link

codecov bot commented Oct 23, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (3ec0ec2) 100.00% compared to head (551bc3b) 100.00%.

Additional details and impacted files
@@                    Coverage Diff                     @@
##           refactor-z-index-context    #45498   +/-   ##
==========================================================
  Coverage                    100.00%   100.00%           
==========================================================
  Files                           697       697           
  Lines                         11743     11744    +1     
  Branches                       3137      3137           
==========================================================
+ Hits                          11743     11744    +1     
Files Coverage Δ
components/menu/SubMenu.tsx 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

// const containers = ['Modal'];
const consumers = ['Dropdown'];
// const consumers = Object.keys(consumerComponent);
// const consumers = ['Dropdown', 'SelectLike', 'ColorPicker', 'DatePicker'];
Copy link
Member

Choose a reason for hiding this comment

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

这些注释,之后可以清理一下

Copy link
Member Author

Choose a reason for hiding this comment

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

好,我再合并到 feature 的时候清理一下

Signed-off-by: kiner-tang(文辉) <1127031143@qq.com>
@kiner-tang kiner-tang merged commit de442ca into refactor-z-index-context Oct 24, 2023
88 checks passed
@kiner-tang kiner-tang deleted the feat-z-index-menu branch October 24, 2023 14:25
@MadCcc MadCcc mentioned this pull request Nov 3, 2023
20 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.

None yet

2 participants