refactor(client): adjust list item style and fix warning (#3315)

* refactor(client): adjust list item style and fix warning

* refactor(client): adjust list item padding

* refactor(client): adjust list style
This commit is contained in:
Junyi 2024-01-04 14:45:14 +08:00 committed by GitHub
parent ba67b7aede
commit 0b1eb36152
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 7 deletions

View File

@ -40,7 +40,7 @@ const InternalListBlockProvider = (props) => {
line-height: 34px;
}
.ant-formily-item-feedback-layout-loose {
margin-bottom: 12px;
margin-bottom: 0;
}
`)}
>

View File

@ -1,12 +1,14 @@
import React from 'react';
import { ObjectField } from '@formily/core';
import { useField } from '@formily/react';
import React from 'react';
import classnames from 'classnames';
import { RecordProvider } from '../../../record-provider';
export const ListItem = (props) => {
const field = useField<ObjectField>();
return (
<div className={'itemCss'}>
<div className={classnames('itemCss', props.className)}>
<RecordProvider record={field.value}>{props.children}</RecordProvider>
</div>
);

View File

@ -7,7 +7,7 @@ const useStyles = genStyleHook('nb-list', (token) => {
[componentCls]: {
width: '100%',
marginBottom: token.marginLG,
'.nb-action-bar': { marginTop: token.marginXS },
'.nb-action-bar:not(:empty)': { marginTop: token.marginXS },
'&:hover': { '> .general-schema-designer': { display: 'block' } },
'> .general-schema-designer': {
position: 'absolute',
@ -40,8 +40,15 @@ const useStyles = genStyleHook('nb-list', (token) => {
display: 'flex',
width: '100%',
flexDirection: 'column',
padding: '4px 5px 0',
borderBottom: `1px solid ${token.colorBorderSecondary}`,
'&:not(:first-child)': {
paddingTop: token.paddingContentVertical,
},
'&:not(:last-child)': {
paddingBottom: token.paddingContentVertical,
borderBottom: `1px solid ${token.colorBorderSecondary}`,
},
},
},
};

View File

@ -28,7 +28,7 @@ export const ImportModal = (props: any) => {
<Modal
title={t('Import Data')}
width="50%"
bodyStyle={{ height: 'calc(80vh - 200px)' }}
styles={{ body: { height: 'calc(80vh - 200px)' } }}
open={importModalVisible}
footer={null}
closable={importStatus === ImportStatus.IMPORTED}