mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-07 22:49:26 +08:00
Merge branch 'next' into develop
This commit is contained in:
commit
f299eedb1b
@ -10,7 +10,7 @@
|
|||||||
import { css } from '@emotion/css';
|
import { css } from '@emotion/css';
|
||||||
import { observer } from '@formily/react';
|
import { observer } from '@formily/react';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { SortableItem, useDesigner } from '../..';
|
import { SortableItem, useDesigner, useSchemaComponentContext } from '../..';
|
||||||
import { useFlag } from '../../../flag-provider/hooks/useFlag';
|
import { useFlag } from '../../../flag-provider/hooks/useFlag';
|
||||||
|
|
||||||
export const designerCss = ({ margin = '-18px -16px', padding = '18px 16px' } = {}) => css`
|
export const designerCss = ({ margin = '-18px -16px', padding = '18px 16px' } = {}) => css`
|
||||||
@ -53,9 +53,15 @@ export const designerCss = ({ margin = '-18px -16px', padding = '18px 16px' } =
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
export const TableColumnActionBar = observer(
|
export const TableColumnActionBar = observer(
|
||||||
(props) => {
|
(props: any) => {
|
||||||
const Designer = useDesigner();
|
const Designer = useDesigner();
|
||||||
const { isInSubTable } = useFlag() || {};
|
const { isInSubTable } = useFlag() || {};
|
||||||
|
const { designable } = useSchemaComponentContext();
|
||||||
|
|
||||||
|
if (!designable || Designer.isNullComponent) {
|
||||||
|
return props.children;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SortableItem
|
<SortableItem
|
||||||
className={designerCss({
|
className={designerCss({
|
||||||
|
@ -17,6 +17,7 @@ import {
|
|||||||
useCompile,
|
useCompile,
|
||||||
useDesigner,
|
useDesigner,
|
||||||
useFlag,
|
useFlag,
|
||||||
|
useSchemaComponentContext,
|
||||||
} from '../../../';
|
} from '../../../';
|
||||||
import { designerCss } from './Table.Column.ActionBar';
|
import { designerCss } from './Table.Column.ActionBar';
|
||||||
import { isCollectionFieldComponent } from './utils';
|
import { isCollectionFieldComponent } from './utils';
|
||||||
@ -71,6 +72,7 @@ export const TableColumnDecorator = (props) => {
|
|||||||
const Designer = useDesigner();
|
const Designer = useDesigner();
|
||||||
const field = useField();
|
const field = useField();
|
||||||
const { fieldSchema, uiSchema, collectionField } = useColumnSchema();
|
const { fieldSchema, uiSchema, collectionField } = useColumnSchema();
|
||||||
|
const { designable } = useSchemaComponentContext();
|
||||||
const compile = useCompile();
|
const compile = useCompile();
|
||||||
const { isInSubTable } = useFlag() || {};
|
const { isInSubTable } = useFlag() || {};
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -84,6 +86,10 @@ export const TableColumnDecorator = (props) => {
|
|||||||
field.title = uiSchema?.title;
|
field.title = uiSchema?.title;
|
||||||
}
|
}
|
||||||
}, [uiSchema?.title]);
|
}, [uiSchema?.title]);
|
||||||
|
|
||||||
|
if (!designable || Designer.isNullComponent) {
|
||||||
|
return props.children;
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<SortableItem
|
<SortableItem
|
||||||
className={designerCss({
|
className={designerCss({
|
||||||
|
@ -750,9 +750,6 @@ const InternalNocoBaseTable = React.memo(
|
|||||||
.ant-table-cell-fix-right {
|
.ant-table-cell-fix-right {
|
||||||
padding: 8px 16px !important;
|
padding: 8px 16px !important;
|
||||||
}
|
}
|
||||||
.ant-table-thead .ant-table-cell {
|
|
||||||
padding: 8px 16px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,7 @@ import { useMemo } from 'react';
|
|||||||
import { SchemaToolbar } from '../../schema-settings';
|
import { SchemaToolbar } from '../../schema-settings';
|
||||||
|
|
||||||
const DefaultSchemaToolbar = () => null;
|
const DefaultSchemaToolbar = () => null;
|
||||||
|
DefaultSchemaToolbar.isNullComponent = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated
|
* @deprecated
|
||||||
|
Loading…
x
Reference in New Issue
Block a user