fix(plugin-workflow-request): fix value fields overflowing (#4354)

This commit is contained in:
Junyi 2024-05-15 18:38:28 +08:00 committed by GitHub
parent 5fa77df58a
commit 6e9ca10644
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 36 additions and 3 deletions

View File

@ -389,6 +389,7 @@ export function TextArea(props) {
.ant-input {
flex-grow: 1;
min-width: 200px;
word-break: break-all;
}
.ant-input-disabled {
.ant-tag {
@ -412,6 +413,7 @@ export function TextArea(props) {
onPaste={onPaste}
onCompositionStart={onCompositionStart}
onCompositionEnd={onCompositionEnd}
placeholder={props.placeholder}
className={cx(
hashId,
'ant-input',
@ -420,6 +422,11 @@ export function TextArea(props) {
overflow: auto;
white-space: ${multiline ? 'normal' : 'nowrap'};
&[placeholder]:empty::before {
content: attr(placeholder);
color: #ccc;
}
.ant-tag {
display: inline;
line-height: 19px;

View File

@ -20,7 +20,7 @@ import {
} from '@nocobase/plugin-workflow/client';
import { NAMESPACE } from '../locale';
import { SchemaComponent } from '@nocobase/client';
import { SchemaComponent, css } from '@nocobase/client';
const BodySchema = {
'application/json': {
@ -173,6 +173,18 @@ export default class extends Instruction {
space: {
type: 'void',
'x-component': 'Space',
'x-component-props': {
style: {
flexWrap: 'nowrap',
maxWidth: '100%',
},
className: css`
& > .ant-space-item:first-child,
& > .ant-space-item:last-child {
flex-shrink: 0;
}
`,
},
properties: {
name: {
type: 'string',
@ -188,6 +200,7 @@ export default class extends Instruction {
'x-component': 'WorkflowVariableTextArea',
'x-component-props': {
useTypedConstant: true,
placeholder: `{{t("Value")}}`,
},
},
remove: {
@ -218,6 +231,18 @@ export default class extends Instruction {
space: {
type: 'void',
'x-component': 'Space',
'x-component-props': {
style: {
flexWrap: 'nowrap',
maxWidth: '100%',
},
className: css`
& > .ant-space-item:first-child,
& > .ant-space-item:last-child {
flex-shrink: 0;
}
`,
},
properties: {
name: {
type: 'string',
@ -233,6 +258,7 @@ export default class extends Instruction {
'x-component': 'WorkflowVariableTextArea',
'x-component-props': {
useTypedConstant: true,
placeholder: `{{t("Value")}}`,
},
},
remove: {

View File

@ -82,8 +82,8 @@ export default class extends Instruction {
return null;
}
return {
[fieldNames.value]: key,
[fieldNames.label]: title,
value: key,
label: title,
};
}
useInitializers(node): SchemaInitializerItemType {