From fe913dd9cdfbe04856a87e39fd2d1987d816872c Mon Sep 17 00:00:00 2001
From: xiaowanzi <350473544@qq.com>
Date: Thu, 23 Apr 2020 13:58:26 +0800
Subject: [PATCH] fix: arrayTable style (#813)
---
packages/antd-components/src/array-table/index.tsx | 2 ++
packages/antd/src/adaptor/FormItem.tsx | 6 +++---
packages/next-components/src/array-table/index.tsx | 2 ++
packages/next/src/adaptor/FormItem.tsx | 6 +++---
4 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/packages/antd-components/src/array-table/index.tsx b/packages/antd-components/src/array-table/index.tsx
index bbcced092be..4d6c686740b 100644
--- a/packages/antd-components/src/array-table/index.tsx
+++ b/packages/antd-components/src/array-table/index.tsx
@@ -81,6 +81,8 @@ export const ArrayTable: any = styled(
diff --git a/packages/antd/src/adaptor/FormItem.tsx b/packages/antd/src/adaptor/FormItem.tsx
index 83a6779450c..3891b6ab35c 100644
--- a/packages/antd/src/adaptor/FormItem.tsx
+++ b/packages/antd/src/adaptor/FormItem.tsx
@@ -72,6 +72,7 @@ export const AntdSchemaFieldAdaptor: React.FC = props
const formItemShallowProps = useShallowFormItem()
const mergedProps = {
+ label,
...formItemShallowProps,
...itemProps,
...schemaItemProps
@@ -95,16 +96,15 @@ export const AntdSchemaFieldAdaptor: React.FC = props
return (
{extra}
: undefined}
{...mergedProps}
required={props.editable === false ? undefined : props.required}
- labelCol={label ? normalizeCol(labelCol || contextLabelCol) : undefined}
+ labelCol={mergedProps.label ? normalizeCol(labelCol || contextLabelCol) : undefined}
wrapperCol={
- label ? normalizeCol(wrapperCol || contextWrapperCol) : undefined
+ mergedProps.label ? normalizeCol(wrapperCol || contextWrapperCol) : undefined
}
>
{children}
diff --git a/packages/next-components/src/array-table/index.tsx b/packages/next-components/src/array-table/index.tsx
index becca088299..1a0cb06f76e 100644
--- a/packages/next-components/src/array-table/index.tsx
+++ b/packages/next-components/src/array-table/index.tsx
@@ -167,6 +167,8 @@ export const ArrayTable = styled(
diff --git a/packages/next/src/adaptor/FormItem.tsx b/packages/next/src/adaptor/FormItem.tsx
index b81dc713648..293e9abb068 100644
--- a/packages/next/src/adaptor/FormItem.tsx
+++ b/packages/next/src/adaptor/FormItem.tsx
@@ -73,6 +73,7 @@ export const NextSchemaFieldAdaptor: React.FC = props
const schemaItemProps = computeSchemaExtendProps(props)
const mergedProps = {
+ label,
...formItemShallowProps,
...itemProps,
...schemaItemProps
@@ -96,7 +97,6 @@ export const NextSchemaFieldAdaptor: React.FC = props
return (
= props
extra={{extra}
}
{...mergedProps}
required={props.editable === false ? undefined : props.required}
- labelCol={label ? normalizeCol(labelCol || contextLabelCol) : undefined}
+ labelCol={mergedProps.label ? normalizeCol(labelCol || contextLabelCol) : undefined}
wrapperCol={
- label ? normalizeCol(wrapperCol || contextWrapperCol) : undefined
+ mergedProps.label ? normalizeCol(wrapperCol || contextWrapperCol) : undefined
}
>
{children}