fix(plugin-workflow): fix styles (#2316)

This commit is contained in:
Junyi 2023-07-25 15:41:42 +07:00 committed by GitHub
parent 30b0d9b3f3
commit e27c72e8b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 83 additions and 65 deletions

View File

@ -5,7 +5,6 @@ const useStyles = genStyleHook('nb-action', (token) => {
return { return {
[componentCls]: { [componentCls]: {
'.renderButton': {
position: 'relative', position: 'relative',
'&:hover': { '> .general-schema-designer': { display: 'block' } }, '&:hover': { '> .general-schema-designer': { display: 'block' } },
'&.nb-action-link': { '&.nb-action-link': {
@ -44,13 +43,6 @@ const useStyles = genStyleHook('nb-action', (token) => {
}, },
}, },
}, },
'.popover': {
display: 'flex',
justifyContent: 'flex-end',
width: '100%',
},
},
}; };
}); });

View File

@ -1,4 +1,5 @@
import { observer, RecursionField, useField, useFieldSchema, useForm } from '@formily/react'; import { observer, RecursionField, useField, useFieldSchema, useForm } from '@formily/react';
import { lodash } from '@nocobase/utils';
import { App, Button, Popover } from 'antd'; import { App, Button, Popover } from 'antd';
import classnames from 'classnames'; import classnames from 'classnames';
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
@ -21,7 +22,6 @@ import { ActionContextProvider } from './context';
import { useA } from './hooks'; import { useA } from './hooks';
import { ComposedAction } from './types'; import { ComposedAction } from './types';
import { linkageAction } from './utils'; import { linkageAction } from './utils';
import { lodash } from '@nocobase/utils';
export const Action: ComposedAction = observer( export const Action: ComposedAction = observer(
(props: any) => { (props: any) => {
@ -105,7 +105,7 @@ export const Action: ComposedAction = observer(
} }
}} }}
component={tarComponent || Button} component={tarComponent || Button}
className={classnames('renderButton', className)} className={classnames(componentCls, hashId, className)}
type={props.type === 'danger' ? undefined : props.type} type={props.type === 'danger' ? undefined : props.type}
> >
{actionTitle} {actionTitle}
@ -115,7 +115,6 @@ export const Action: ComposedAction = observer(
}; };
return wrapSSR( return wrapSSR(
<div className={`${componentCls} ${hashId}`}>
<ActionContextProvider <ActionContextProvider
button={renderButton()} button={renderButton()}
visible={visible} visible={visible}
@ -131,8 +130,7 @@ export const Action: ComposedAction = observer(
{!popover && renderButton()} {!popover && renderButton()}
{!popover && <div onClick={(e) => e.stopPropagation()}>{props.children}</div>} {!popover && <div onClick={(e) => e.stopPropagation()}>{props.children}</div>}
{element} {element}
</ActionContextProvider> </ActionContextProvider>,
</div>,
); );
}, },
{ displayName: 'Action' }, { displayName: 'Action' },
@ -160,7 +158,17 @@ Action.Popover = observer(
Action.Popover.Footer = observer( Action.Popover.Footer = observer(
(props) => { (props) => {
return <div className="popover">{props.children}</div>; return (
<div
style={{
display: 'flex',
justifyContent: 'flex-end',
width: '100%',
}}
>
{props.children}
</div>
);
}, },
{ displayName: 'Action.Popover.Footer' }, { displayName: 'Action.Popover.Footer' },
); );

View File

@ -441,10 +441,25 @@ export function NodeDefaultView(props) {
'x-component': 'fieldset', 'x-component': 'fieldset',
'x-component-props': { 'x-component-props': {
className: css` className: css`
.ant-input,
.ant-select, .ant-select,
.ant-cascader-picker, .ant-cascader-picker,
.ant-picker, .ant-picker,
.ant-input-number, .ant-input-number,
.ant-input-affix-wrapper {
&:not(.full-width) {
width: auto;
min-width: 6em;
}
}
.ant-input-affix-wrapper {
&:not(.full-width) {
.ant-input {
width: auto;
min-width: 6em;
}
}
}
`, `,
}, },
properties: instruction.fieldset, properties: instruction.fieldset,

View File

@ -96,7 +96,7 @@ const useStyles = createStyles(({ css, token }) => {
bottom: 0; bottom: 0;
left: calc(50% - 0.5px); left: calc(50% - 0.5px);
width: 1px; width: 1px;
background-color: ${token.colorBorder}; background-color: ${token.colorBgLayout};
} }
`, `,
@ -220,7 +220,9 @@ const useStyles = createStyles(({ css, token }) => {
font-weight: bold; font-weight: bold;
&:not(:focus) { &:not(:focus) {
transition: background-color 0.3s ease, border-color 0.3s ease; transition:
background-color 0.3s ease,
border-color 0.3s ease;
border-color: ${token.colorBorderBg}; border-color: ${token.colorBorderBg};
background-color: ${token.colorBgContainerDisabled}; background-color: ${token.colorBgContainerDisabled};
@ -254,7 +256,7 @@ const useStyles = createStyles(({ css, token }) => {
right: 1em; right: 1em;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
color: ${token.colorText}; color: ${token.colorTextLightSolid};
&[type='button'] { &[type='button'] {
border: none; border: none;
@ -327,6 +329,7 @@ const useStyles = createStyles(({ css, token }) => {
top: calc(1.5em - 1px); top: calc(1.5em - 1px);
line-height: 1em; line-height: 1em;
color: ${token.colorTextSecondary}; color: ${token.colorTextSecondary};
background-color: ${token.colorBgLayout};
padding: 1px; padding: 1px;
} }
`, `,