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

fix(Radio, Checkbox): export required prop type #46028

Merged
merged 1 commit into from Nov 23, 2023

Conversation

nnmax
Copy link
Contributor

@nnmax nnmax commented Nov 22, 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

close #46025

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English Exporting the Type Definition of the required prop of the Radio and Checkbox Components
🇨🇳 Chinese 导出 Radio 和 Checkbox 组件的 required 属性的类型定义

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

🤖[deprecated] Generated by Copilot at 5150c9a

This pull request adds a new required prop to the Checkbox and Radio components and their respective groups, allowing users to mark them as mandatory for form validation. It also updates the documentation and demos for both components in English and Chinese to reflect the new feature.

🔍 Walkthrough

🤖[deprecated] Generated by Copilot at 5150c9a

  • Add a new required prop to the Checkbox and Radio components and their group variants, which enables the native form validation for the inputs when they are set to true (link, link, link, link)
  • Pass the required prop from the options array to the individual Checkbox and Radio components inside the Checkbox.Group and Radio.Group components, respectively, to apply the validation to each option (link, link)
  • Document the required prop and its type and functionality in the English and Chinese versions of the documentation for the Checkbox and Radio components and their group variants (components/checkbox/index.en-US.md, components/checkbox/index.zh-CN.md, components/radio/index.en-US.md, components/radio/index.zh-CN.md) (link, link, link, link, link, link, link)
  • Update the basic.tsx demo file for the Checkbox component to showcase the usage and effect of the required prop with both Checkbox and Radio components in a form (components/checkbox/demo/basic.tsx) (link, link)

Copy link

stackblitz bot commented Nov 22, 2023

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

Copy link
Contributor

github-actions bot commented Nov 22, 2023

Preview Is ready

Copy link

codesandbox-ci bot commented Nov 22, 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 90a1ca6:

Sandbox Source
antd reproduction template (forked) Configuration

Copy link

argos-ci bot commented Nov 22, 2023

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No change detected - Nov 23, 2023, 2:24 AM

Copy link

codecov bot commented Nov 22, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (110e1b3) 100.00% compared to head (90a1ca6) 100.00%.
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master    #46028   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          700       700           
  Lines        11855     11855           
  Branches      3161      3161           
=========================================
  Hits         11855     11855           

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

@afc163 afc163 merged commit bb5dd4d into ant-design:master Nov 23, 2023
55 checks passed
@nnmax nnmax deleted the feat/radio-required branch November 23, 2023 12:28
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.

<Redio /> 组件支持 required 属性
3 participants