style: list block style improve (#4785)

This commit is contained in:
Katherine 2024-07-01 16:38:02 +08:00 committed by GitHub
parent 59c9c0e06e
commit 12a8f2e6ac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 37 additions and 45 deletions

View File

@ -358,16 +358,7 @@ export const Grid: any = observer(
return ( return (
<FilterBlockProvider> <FilterBlockProvider>
<GridContext.Provider value={gridContextValue}> <GridContext.Provider value={gridContextValue}>
<div <div className={cls('nb-grid-container')}>
className={cls(
'nb-grid-container',
// css`
// & {
// margin-bottom: ${designable ? 0 : -token.marginLG}px;
// }
// `,
)}
>
<div className={cls(`nb-grid ${styles.container}`)} style={{ position: 'relative' }} ref={gridRef}> <div className={cls(`nb-grid ${styles.container}`)} style={{ position: 'relative' }} ref={gridRef}>
<div className="nb-grid-warp"> <div className="nb-grid-warp">
<DndWrapper dndContext={props.dndContext}> <DndWrapper dndContext={props.dndContext}>

View File

@ -75,46 +75,47 @@ const InternalList = (props) => {
componentCls, componentCls,
hashId, hashId,
css` css`
.ant-spin-nested-loading { .nb-list-container {
height: ${height ? height + 'px' : '100%'}; height: ${height ? height + 'px' : '100%'};
overflow-y: ${height ? 'auto' : 'null'}; overflow-y: auto;
.ant-spin-container { margin-left: -${token.marginLG}px;
width: 100%; margin-right: -${token.marginLG}px;
overflow-x: clip; padding-left: ${token.marginLG}px;
padding-right: ${token.paddingSM + 'px'}; padding-right: ${token.marginLG}px;
}
} }
`, `,
)} )}
> >
<AntdList <div className="nb-list-container">
{...props} <AntdList
pagination={ {...props}
!meta || meta.count <= meta.pageSize pagination={
? false !meta || meta.count <= meta.pageSize
: { ? false
onChange: onPaginationChange, : {
total: meta?.count || 0, onChange: onPaginationChange,
pageSize: meta?.pageSize || 10, total: meta?.count || 0,
current: meta?.page || 1, pageSize: meta?.pageSize || 10,
} current: meta?.page || 1,
} }
loading={service?.loading} }
> loading={service?.loading}
{field.value?.length >
? field.value.map((item, index) => { {field.value?.length
return ( ? field.value.map((item, index) => {
<RecursionField return (
basePath={field.address} <RecursionField
key={index} basePath={field.address}
name={index} key={index}
onlyRenderProperties name={index}
schema={getSchema(index)} onlyRenderProperties
></RecursionField> schema={getSchema(index)}
); ></RecursionField>
}) );
: null} })
</AntdList> : null}
</AntdList>
</div>
<Designer /> <Designer />
</SortableItem> </SortableItem>
</SchemaComponentOptions>, </SchemaComponentOptions>,