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: ColorPicker implement panelRender API #43134

Merged
merged 13 commits into from
Jun 29, 2023

Conversation

RedJue
Copy link
Member

@RedJue RedJue commented Jun 21, 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

#42749
[RFC] ColorPicker implement panelRender API

💡 Background and solution

Add title
image
Horizontal layout
image

📝 Changelog

Language Changelog
🇺🇸 English ColorPicker implement panelRender API
🇨🇳 Chinese 颜色选择器实现 panelRender API

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

Added a panelRender prop to the ColorPicker component to enable custom panel rendering. Created new components and contexts to support the prop and its functionality. Added a new demo and updated the documentation to show the usage of the prop and its custom components. Fixed a style conflict between the Popover and the RcColorPicker components.

🔍 Walkthrough

🤖 Generated by Copilot at f75c89f

  • Add panelRender prop to ColorPicker component to allow customizing the color picker panel (link, link, link)
  • Pass panelRender prop to RcColorPicker component and rename style prop to overlayInnerStyle for Popover component (link, link)
  • Refactor ColorPickerPanel component to use PanelPicker and PanelPresets components and their context providers (link, link)
  • Create PanelPicker component to render ColorClear, ColorInput, and panel prop from RcColorPicker component using PanelPickerContext (link, link)
  • Create PanelPresets component to render ColorPresets component using PanelPresetsContext (link, link)
  • Move display and flexDirection styles from ${componentCls}-panel selector to ${componentCls}-inner-panel selector in components/color-picker/style/index.ts (link)
  • Add test case for panelRender prop and its custom components in components/color-picker/__tests__/index.test.tsx (link)
  • Add demo and documentation for panelRender prop and its custom components in components/color-picker/demo/panel-render.md, components/color-picker/demo/panel-render.tsx, and components/color-picker/index.zh-CN.md (link, link, link)

@github-actions
Copy link
Contributor

github-actions bot commented Jun 21, 2023

@github-actions
Copy link
Contributor

github-actions bot commented Jun 21, 2023

size-limit report 📦

Path Size
./dist/antd.min.js 378.97 KB (+207 B 🔺)
./dist/antd-with-locales.min.js 438.38 KB (+243 B 🔺)

@codecov
Copy link

codecov bot commented Jun 21, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (2490d43) 100.00% compared to head (29c8ca8) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##           feature    #43134   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          654       657    +3     
  Lines        11002     11018   +16     
  Branches      2983      2986    +3     
=========================================
+ Hits         11002     11018   +16     
Impacted Files Coverage Δ
components/color-picker/ColorPicker.tsx 100.00% <ø> (ø)
components/color-picker/style/picker.ts 100.00% <ø> (ø)
components/color-picker/style/presets.ts 100.00% <ø> (ø)
components/color-picker/ColorPickerPanel.tsx 100.00% <100.00%> (ø)
components/color-picker/components/PanelPicker.tsx 100.00% <100.00%> (ø)
...omponents/color-picker/components/PanelPresets.tsx 100.00% <100.00%> (ø)
components/color-picker/context.ts 100.00% <100.00%> (ø)
components/color-picker/style/index.ts 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@RedJue RedJue requested a review from MadCcc June 21, 2023 03:23
@li-jia-nan
Copy link
Member

冲突了

@RedJue
Copy link
Member Author

RedJue commented Jun 21, 2023

冲突了

刚合了另一个 pr 我一会处理一下

@RedJue RedJue force-pushed the feature-color-picker-panelrender branch 2 times, most recently from 072ad90 to 5f21f87 Compare June 24, 2023 15:06
@RedJue RedJue force-pushed the feature-color-picker-panelrender branch from 3339fb2 to 2f4b31b Compare June 25, 2023 06:22
@RedJue RedJue force-pushed the feature-color-picker-panelrender branch from 473a785 to 814c1c6 Compare June 26, 2023 03:58
@RedJue RedJue force-pushed the feature-color-picker-panelrender branch 2 times, most recently from a0b836f to eb481ec Compare June 27, 2023 06:56
@RedJue RedJue force-pushed the feature-color-picker-panelrender branch 2 times, most recently from 708040f to 35f4a80 Compare June 28, 2023 10:27
@RedJue RedJue force-pushed the feature-color-picker-panelrender branch from 960f2b0 to 29c8ca8 Compare June 29, 2023 03:04
@MadCcc MadCcc merged commit 6bb18b3 into feature Jun 29, 2023
@MadCcc MadCcc deleted the feature-color-picker-panelrender branch June 29, 2023 03:46
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.

3 participants