diff --git a/components/form/FormItem/ItemHolder.tsx b/components/form/FormItem/ItemHolder.tsx index 2f2fa4cf9dbf..928a0b490703 100644 --- a/components/form/FormItem/ItemHolder.tsx +++ b/components/form/FormItem/ItemHolder.tsx @@ -135,6 +135,7 @@ export default function ItemHolder(props: ItemHolderProps) { 'validateTrigger', 'valuePropName', 'wrapperCol', + 'validateDebounce', ])} > {/* Label */} diff --git a/components/form/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/form/__tests__/__snapshots__/demo-extend.test.ts.snap index b5c9c34b3da0..213d583d9486 100644 --- a/components/form/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/form/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -27899,6 +27899,168 @@ exports[`renders components/form/demo/validate-static.tsx extend context correct exports[`renders components/form/demo/validate-static.tsx extend context correctly 2`] = `[]`; +exports[`renders components/form/demo/validate-trigger.tsx extend context correctly 1`] = ` +
+`; + +exports[`renders components/form/demo/validate-trigger.tsx extend context correctly 2`] = `[]`; + exports[`renders components/form/demo/warning-only.tsx extend context correctly 1`] = ` +`; + exports[`renders components/form/demo/warning-only.tsx correctly 1`] = `label can wrap
No block rule
Watch Hooks
+Validate Trigger
Validate Only
Path Prefix
Dynamic Form Item
@@ -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 milliseconds to start validation | number | - | 5.9.0 |
| validateFirst | Whether stop validate on first rule of error for this field. Will parallel validate when `parallel` configured | boolean \| `parallel` | false | `parallel`: 4.5.0 |
| validateStatus | The validation status. If not provided, it will be generated by validation rule. options: `success` `warning` `error` `validating` | string | - | |
| validateTrigger | When to validate the value of children node | string \| string\[] | `onChange` | |
diff --git a/components/form/index.zh-CN.md b/components/form/index.zh-CN.md
index 108f4679ee67..2b6c6ebc9e90 100644
--- a/components/form/index.zh-CN.md
+++ b/components/form/index.zh-CN.md
@@ -27,6 +27,7 @@ coverDark: https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*ylFATY6w-ygAAA
表单标签可换行
非阻塞校验
字段监听 Hooks
+校验时机
仅校验
字段路径前缀
动态增减表单项
@@ -144,6 +145,7 @@ const validateMessages = {
| tooltip | 配置提示信息 | ReactNode \| [TooltipProps & { icon: ReactNode }](/components/tooltip-cn#api) | - | 4.7.0 |
| trigger | 设置收集字段值变更的时机。点击[此处](#components-form-demo-customized-form-controls)查看示例 | string | `onChange` | |
| validateFirst | 当某一规则校验不通过时,是否停止剩下的规则的校验。设置 `parallel` 时会并行校验 | boolean \| `parallel` | false | `parallel`: 4.5.0 |
+| validateDebounce | 设置防抖,延迟毫秒数后进行校验 | number | - | 5.9.0 |
| validateStatus | 校验状态,如不设置,则会根据校验规则自动生成,可选:'success' 'warning' 'error' 'validating' | string | - | |
| validateTrigger | 设置字段校验的时机 | string \| string\[] | `onChange` | |
| valuePropName | 子节点的值的属性,如 Switch、Checkbox 的是 `checked`。该属性为 `getValueProps` 的封装,自定义 `getValueProps` 后会失效 | string | `value` | |
diff --git a/package.json b/package.json
index cdf75b687a25..2c6ca74910d2 100644
--- a/package.json
+++ b/package.json
@@ -129,7 +129,7 @@
"rc-dialog": "~9.2.0",
"rc-drawer": "~6.4.1",
"rc-dropdown": "~4.1.0",
- "rc-field-form": "~1.37.0",
+ "rc-field-form": "~1.38.0",
"rc-image": "~7.2.0",
"rc-input": "~1.1.0",
"rc-input-number": "~8.0.2",