mirror of
https://gitee.com/nocobase/nocobase.git
synced 2024-11-30 11:18:36 +08:00
fix: remove grid wrap (#4612)
This commit is contained in:
parent
328b0da846
commit
1d2ac6b85e
@ -9,15 +9,18 @@
|
||||
|
||||
import _ from 'lodash';
|
||||
import React from 'react';
|
||||
import { GridRowContext } from '../../../../schema-component/antd/grid/Grid';
|
||||
import { SchemaToolbar } from '../../../../schema-settings';
|
||||
|
||||
export const TableColumnSchemaToolbar = (props) => {
|
||||
return (
|
||||
<SchemaToolbar
|
||||
initializer={props.initializer || false}
|
||||
showBorder={false}
|
||||
showBackground
|
||||
{..._.omit(props, 'initializer')}
|
||||
/>
|
||||
<GridRowContext.Provider value={null}>
|
||||
<SchemaToolbar
|
||||
initializer={props.initializer || false}
|
||||
showBorder={false}
|
||||
showBackground
|
||||
{..._.omit(props, 'initializer')}
|
||||
/>
|
||||
</GridRowContext.Provider>
|
||||
);
|
||||
};
|
||||
|
@ -21,7 +21,7 @@ import { DndContext, DndContextProps } from '../../common/dnd-context';
|
||||
import { useToken } from '../__builtins__';
|
||||
import useStyles from './Grid.style';
|
||||
|
||||
const GridRowContext = createContext<any>({});
|
||||
export const GridRowContext = createContext<any>({});
|
||||
GridRowContext.displayName = 'GridRowContext';
|
||||
const GridColContext = createContext<any>({});
|
||||
GridColContext.displayName = 'GridColContext';
|
||||
|
@ -228,11 +228,10 @@ const InternalSchemaToolbar: FC<SchemaToolbarProps> = (props) => {
|
||||
);
|
||||
const rowCtx = useGridRowContext();
|
||||
const gridContext = useGridContext();
|
||||
|
||||
const initializerProps: any = useMemo(() => {
|
||||
return {
|
||||
insertPosition: 'afterEnd',
|
||||
wrap: rowCtx?.cols?.length > 1 ? undefined : gridRowColWrap,
|
||||
wrap: rowCtx?.cols?.length === 1 ? gridRowColWrap : undefined,
|
||||
Component: (props: any) => (
|
||||
<PlusOutlined
|
||||
{...props}
|
||||
|
Loading…
Reference in New Issue
Block a user