From eeac65c230be8d7dfe28b159dcd7e716c62dfa72 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B0=8F=E5=9B=9B?= <1104464423@qq.com>
Date: Fri, 6 Oct 2023 12:28:44 +0800
Subject: [PATCH] feat: Support labelFor props in (#3974)
---
packages/antd/src/form-item/index.tsx | 2 ++
packages/next/src/form-item/index.tsx | 2 ++
2 files changed, 4 insertions(+)
diff --git a/packages/antd/src/form-item/index.tsx b/packages/antd/src/form-item/index.tsx
index fe81f08ffb8..8793253fa7f 100644
--- a/packages/antd/src/form-item/index.tsx
+++ b/packages/antd/src/form-item/index.tsx
@@ -24,6 +24,7 @@ export interface IFormItemProps {
tooltipLayout?: 'icon' | 'text'
labelStyle?: React.CSSProperties
labelAlign?: 'left' | 'right'
+ labelFor?: string
labelWrap?: boolean
labelWidth?: number | string
wrapperWidth?: number | string
@@ -238,6 +239,7 @@ export const BaseItem: React.FC> = ({
{'*'}
)}
+
{!asterisk && requiredMark === 'optional' && !optionalMarkHidden && (
{locale?.Form?.optional}
diff --git a/packages/next/src/form-item/index.tsx b/packages/next/src/form-item/index.tsx
index 2adafd2d590..28a592ee8f9 100644
--- a/packages/next/src/form-item/index.tsx
+++ b/packages/next/src/form-item/index.tsx
@@ -23,6 +23,7 @@ export interface IFormItemProps {
tooltip?: React.ReactNode
tooltipLayout?: 'icon' | 'text'
tooltipIcon?: React.ReactNode
+ labelFor?: string
labelStyle?: React.CSSProperties
labelAlign?: 'left' | 'right'
labelWrap?: boolean
@@ -227,6 +228,7 @@ export const BaseItem: React.FC> = (
{'*'}
)}
+
)