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: Form validation support validateDebounce #44633

Merged
merged 5 commits into from Sep 5, 2023
Merged

Conversation

zombieJ
Copy link
Member

@zombieJ zombieJ commented Sep 5, 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

resolve #44585

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English 🔥 Form.Item support validateDebounce to delay validation.
🇨🇳 Chinese 🔥 Form.Item 支持 validateDebounce 以配置校验防抖。

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

This pull request adds new validation-related props to the Form.Item component and updates the documentation and demo code accordingly. It also updates the dependency version of the rc-field-form package to enable these new features.

🔍 Walkthrough

🤖 Generated by Copilot at ef177f2

  • Add new props validateTrigger, validateDebounce, and validateFirst to Form.Item component for async validation scenarios (link, link, link, link)
  • Update rc-field-form dependency version to ~1.38.0 in package.json to use the new features of the package (link)
  • Add demo code and link for the new props in both English and Chinese documentation files (components/form/demo/validate-trigger.tsx, link, link)

@stackblitz
Copy link

stackblitz bot commented Sep 5, 2023

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

@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2023

@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2023

size-limit report 📦

Path Size
./dist/antd.min.js 393.47 KB (+236 B 🔺)
./dist/antd-with-locales.min.js 452.66 KB (+261 B 🔺)

@socket-security
Copy link

Updated dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
rc-field-form 1.37.0...1.38.0 None +0/-0 287 kB

@argos-ci
Copy link

argos-ci bot commented Sep 5, 2023

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

Build Status Details Updated (UTC)
default (Inspect) 👍 Changes approved 183 changes Sep 5, 2023, 9:50 AM

@codecov
Copy link

codecov bot commented Sep 5, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (114ff39) 100.00% compared to head (cc0dcd7) 100.00%.
Report is 1 commits behind head on feature.

Additional details and impacted files
@@            Coverage Diff            @@
##           feature    #44633   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          680       680           
  Lines        11417     11417           
  Branches      3073      3073           
=========================================
  Hits         11417     11417           
Files Changed Coverage Δ
components/form/FormItem/ItemHolder.tsx 100.00% <ø> (ø)

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

@@ -142,6 +143,7 @@ Form field component for data bidirectional binding, validation, layout, and so
| shouldUpdate | Custom field update logic. See [below](#shouldupdate) | boolean \| (prevValue, curValue) => boolean | false | |
| tooltip | Config tooltip info | ReactNode \| [TooltipProps & { icon: ReactNode }](/components/tooltip#api) | - | 4.7.0 |
| trigger | When to collect the value of children node. Click [here](#components-form-demo-customized-form-controls) to see an example | string | `onChange` | |
| validateDebounce | Delay million second to start validation | number | - | 5.9.0 |
Copy link
Contributor

Choose a reason for hiding this comment

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

million second ?
I guess it should be milliseconds (ms)

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

7 participants