Skip to content

Commit

Permalink
fix: arrayTable style (#813)
Browse files Browse the repository at this point in the history
  • Loading branch information
liuqiao1 authored Apr 23, 2020
1 parent fab2230 commit fe913dd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions packages/antd-components/src/array-table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ export const ArrayTable: any = styled(
<FormItemShallowProvider
key={newPath.toString()}
label={undefined}
labelCol={undefined}
wrapperCol={undefined}
>
<SchemaField path={newPath} schema={props} />
</FormItemShallowProvider>
Expand Down
6 changes: 3 additions & 3 deletions packages/antd/src/adaptor/FormItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export const AntdSchemaFieldAdaptor: React.FC<ISchemaFieldAdaptorProps> = props
const formItemShallowProps = useShallowFormItem()

const mergedProps = {
label,
...formItemShallowProps,
...itemProps,
...schemaItemProps
Expand All @@ -95,16 +96,15 @@ export const AntdSchemaFieldAdaptor: React.FC<ISchemaFieldAdaptorProps> = props
return (
<Form.Item
prefixCls={prefixCls}
label={label}
labelAlign={labelAlign}
help={help}
validateStatus={status}
extra={extra ? <p>{extra}</p> : 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}
Expand Down
2 changes: 2 additions & 0 deletions packages/next-components/src/array-table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ export const ArrayTable = styled(
<FormItemShallowProvider
key={newPath.toString()}
label={undefined}
labelCol={undefined}
wrapperCol={undefined}
>
<SchemaField path={newPath} schema={props} />
</FormItemShallowProvider>
Expand Down
6 changes: 3 additions & 3 deletions packages/next/src/adaptor/FormItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export const NextSchemaFieldAdaptor: React.FC<ISchemaFieldAdaptorProps> = props
const schemaItemProps = computeSchemaExtendProps(props)

const mergedProps = {
label,
...formItemShallowProps,
...itemProps,
...schemaItemProps
Expand All @@ -96,7 +97,6 @@ export const NextSchemaFieldAdaptor: React.FC<ISchemaFieldAdaptorProps> = props
return (
<Form.Item
prefix={prefix}
label={label}
labelTextAlign={labelTextAlign}
labelAlign={labelAlign || 'left'}
size={size}
Expand All @@ -105,9 +105,9 @@ export const NextSchemaFieldAdaptor: React.FC<ISchemaFieldAdaptorProps> = props
extra={<p>{extra}</p>}
{...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}
Expand Down

0 comments on commit fe913dd

Please sign in to comment.