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: color-picker panel dom logic #46327

Merged
merged 12 commits into from Dec 18, 2023

Conversation

Wxh16144
Copy link
Member

@Wxh16144 Wxh16144 commented Dec 7, 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

ref: #45527 (comment)

💡 Background and solution

将原来 .ant-color-picker-inner-content 类名 拆为 2 个,分别 .ant-color-picker-inner.ant-color-picker-inner-content

.ant-color-picker-inner: 表示这个面板容器,与面板有关的样式写这个类名下。
.ant-color-picker-inner-content: 默认为 antd 颜色选择器面板容器。该类名只存在覆写 antd 内部样式。

如果开发者通过 panelRender 完全自定义内容时,默认插入到 .ant-color-picker-inner 容器下,而不是 .ant-color-picker-inner-content.(这样就可以避免样式冲突。

📝 Changelog

Language Changelog
🇺🇸 English Refactoring ColorPicker popup panel dom tree logic
🇨🇳 Chinese 重构 ColorPicker 弹出面板 dom tree 逻辑

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

Copy link

stackblitz bot commented Dec 7, 2023

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

Copy link
Contributor

github-actions bot commented Dec 7, 2023

Preview Is ready

@Wxh16144 Wxh16144 mentioned this pull request Dec 7, 2023
20 tasks
@Wxh16144
Copy link
Member Author

Wxh16144 commented Dec 7, 2023

有 BreakChange 风险 🤔

@MadCcc MadCcc changed the title refactor: color-pciker panel dom logic refactor: color-picker panel dom logic Dec 8, 2023
Copy link
Member

@MadCcc MadCcc left a comment

Choose a reason for hiding this comment

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

LGTM

# Conflicts:
#	components/color-picker/__tests__/__snapshots__/index.test.tsx.snap
#	components/color-picker/demo/panel-render.tsx
#	components/form/__tests__/__snapshots__/demo-extend.test.ts.snap
#	components/table/InternalTable.tsx
Copy link

codesandbox-ci bot commented Dec 15, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 097d170:

Sandbox Source
antd reproduction template (forked) Configuration

Copy link
Contributor

github-actions bot commented Dec 15, 2023

Visual Regression Report for PR #46327

Target branch: feature (8ccd23a)
View Full Report


image name expected actual diff
color-picker-panel-render.png feature: 8ccd23a4cab26fd3c28877f82ace1a3d9b9b4450 current: pr-46327 diff
color-picker-panel-render.css-var.png feature: 8ccd23a4cab26fd3c28877f82ace1a3d9b9b4450 current: pr-46327 diff

Copy link

codecov bot commented Dec 15, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e88d6e6) 100.00% compared to head (097d170) 100.00%.
Report is 20 commits behind head on feature.

Additional details and impacted files
@@            Coverage Diff            @@
##           feature    #46327   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          709       709           
  Lines        12148     12148           
  Branches      3225      3225           
=========================================
  Hits         12148     12148           

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

@MadCcc
Copy link
Member

MadCcc commented Dec 15, 2023

compact 主题下有 diff

@Wxh16144

This comment was marked as outdated.

@Wxh16144 Wxh16144 closed this Dec 15, 2023
@Wxh16144 Wxh16144 reopened this Dec 15, 2023
# Conflicts:
#	components/color-picker/__tests__/__snapshots__/demo-extend.test.ts.snap
@Wxh16144
Copy link
Member Author

compact 主题下有 diff

本地跑了一下视觉回归,这个变动是符合预期的。(该 PR 的 demo 相比于之前少了一个 <Row > 的嵌套)

image

@MadCcc MadCcc merged commit ce7da2e into ant-design:feature Dec 18, 2023
61 checks passed
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