diff --git a/packages/core/client/src/schema-component/antd/action/Action.style.ts b/packages/core/client/src/schema-component/antd/action/Action.style.ts index 0c89a1290..9a512d45e 100644 --- a/packages/core/client/src/schema-component/antd/action/Action.style.ts +++ b/packages/core/client/src/schema-component/antd/action/Action.style.ts @@ -5,50 +5,42 @@ const useStyles = genStyleHook('nb-action', (token) => { return { [componentCls]: { - '.renderButton': { - position: 'relative', - '&:hover': { '> .general-schema-designer': { display: 'block' } }, - '&.nb-action-link': { - '> .general-schema-designer': { - top: '-10px', - bottom: '-10px', - left: '-10px', - right: '-10px', - }, - }, + position: 'relative', + '&:hover': { '> .general-schema-designer': { display: 'block' } }, + '&.nb-action-link': { '> .general-schema-designer': { - position: 'absolute', - zIndex: 999, - top: '0', - bottom: '0', - left: '0', - right: '0', - display: 'none', - background: 'var(--colorBgSettingsHover)', - border: '0', - pointerEvents: 'none', - '> .general-schema-designer-icons': { - position: 'absolute', - right: '2px', - top: '2px', - lineHeight: '16px', - pointerEvents: 'all', - '.ant-space-item': { - backgroundColor: token.colorSettings, - color: '#fff', - lineHeight: '16px', - width: '16px', - paddingLeft: '1px', - alignSelf: 'stretch', - }, - }, + top: '-10px', + bottom: '-10px', + left: '-10px', + right: '-10px', }, }, - - '.popover': { - display: 'flex', - justifyContent: 'flex-end', - width: '100%', + '> .general-schema-designer': { + position: 'absolute', + zIndex: 999, + top: '0', + bottom: '0', + left: '0', + right: '0', + display: 'none', + background: 'var(--colorBgSettingsHover)', + border: '0', + pointerEvents: 'none', + '> .general-schema-designer-icons': { + position: 'absolute', + right: '2px', + top: '2px', + lineHeight: '16px', + pointerEvents: 'all', + '.ant-space-item': { + backgroundColor: token.colorSettings, + color: '#fff', + lineHeight: '16px', + width: '16px', + paddingLeft: '1px', + alignSelf: 'stretch', + }, + }, }, }, }; diff --git a/packages/core/client/src/schema-component/antd/action/Action.tsx b/packages/core/client/src/schema-component/antd/action/Action.tsx index e68dfdb37..dc53882d1 100644 --- a/packages/core/client/src/schema-component/antd/action/Action.tsx +++ b/packages/core/client/src/schema-component/antd/action/Action.tsx @@ -1,4 +1,5 @@ import { observer, RecursionField, useField, useFieldSchema, useForm } from '@formily/react'; +import { lodash } from '@nocobase/utils'; import { App, Button, Popover } from 'antd'; import classnames from 'classnames'; import React, { useEffect, useState } from 'react'; @@ -21,7 +22,6 @@ import { ActionContextProvider } from './context'; import { useA } from './hooks'; import { ComposedAction } from './types'; import { linkageAction } from './utils'; -import { lodash } from '@nocobase/utils'; export const Action: ComposedAction = observer( (props: any) => { @@ -105,7 +105,7 @@ export const Action: ComposedAction = observer( } }} component={tarComponent || Button} - className={classnames('renderButton', className)} + className={classnames(componentCls, hashId, className)} type={props.type === 'danger' ? undefined : props.type} > {actionTitle} @@ -115,24 +115,22 @@ export const Action: ComposedAction = observer( }; return wrapSSR( -