-
-
Notifications
You must be signed in to change notification settings - Fork 323
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: semantic support content、body #922
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Walkthrough本次变更主要是为 Picker 组件系统添加对样式(styles)和类名(classNames)的支持。更新涉及 PickerInput、PickerPanel 以及相关上下文接口,通过在 context 对象中引入新的属性,并同步更新 memo 化依赖项,确保样式信息能动态传递给子组件。同时更新了 SemanticStructure 类型以支持更多语义,同时扩展了测试用例以验证这些新功能。 Changes
Sequence Diagram(s)sequenceDiagram
participant P as Picker组件
participant C as PickerContext.Provider
participant S as 子组件
P->>C: 提供包含 prefixCls, styles, classNames 的 context
C->>S: 传递 context,子组件消费并应用样式
Possibly related PRs
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 ESLint
src/PickerPanel/PanelBody.tsxOops! Something went wrong! :( ESLint: 8.57.1 Error: Cannot read config file: /.eslintrc.js
src/interface.tsxOops! Something went wrong! :( ESLint: 8.57.1 Error: Cannot read config file: /.eslintrc.js
tests/picker.spec.tsxOops! Something went wrong! :( ESLint: 8.57.1 Error: Cannot read config file: /.eslintrc.js
Tip ⚡🧪 Multi-step agentic review comment chat (experimental)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used🧬 Code Definitions (1)tests/picker.spec.tsx (2)
🔇 Additional comments (3)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
src/interface.tsx
Outdated
@@ -281,7 +281,7 @@ export type Components<DateType extends object = any> = Partial< | |||
>; | |||
|
|||
// ========================= Picker ========================= | |||
export type SemanticStructure = 'popup'; | |||
export type SemanticStructure = 'popup' | 'body' | 'content'; |
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.
popupBody & popupContent?
@@ -281,7 +281,7 @@ export type Components<DateType extends object = any> = Partial< | |||
>; | |||
|
|||
// ========================= Picker ========================= | |||
export type SemanticStructure = 'popup'; | |||
export type SemanticStructure = 'popup' | 'popupBody' | 'popupContent'; |
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.
calendar 的header是内部自定义的,好像只需要content、body 就足够完成 calendar 的语义化了。 当时看到 日历组件比较复杂,还没想到比较好的解法,想着也先往后放放,先把好做的都做掉先。
https://github.com/ant-design/ant-design/pull/53159/files#diff-841e97dfb23daba72a34ee15810c8b36da6464eba16e120739ec6c9636f94fb2L287
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #922 +/- ##
=======================================
Coverage 98.79% 98.79%
=======================================
Files 64 64
Lines 2651 2652 +1
Branches 736 710 -26
=======================================
+ Hits 2619 2620 +1
Misses 29 29
Partials 3 3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary by CodeRabbit