diff --git a/packages/core/client/src/schema-component/antd/variable/Input.tsx b/packages/core/client/src/schema-component/antd/variable/Input.tsx index 9a95ae2ded..23993aad16 100644 --- a/packages/core/client/src/schema-component/antd/variable/Input.tsx +++ b/packages/core/client/src/schema-component/antd/variable/Input.tsx @@ -398,105 +398,107 @@ export function Input(props: VariableInputProps) { const disabled = props.disabled || form.disabled; return wrapSSR( - - {/* 确保所有ant input样式都已加载 */} - - {variable ? ( -
+ <> + + {variable ? (
- - {variableText.map((item, index) => { - return ( - - {index ? ' / ' : ''} - {item} - - ); - })} - -
- {!disabled ? ( - - - - ) : null} -
- ) : ( -
- {children && (isFieldValue || !nullable) ? ( - children - ) : ConstantComponent ? ( - - ) : null} -
- )} - {hideVariableButton ? null : ( - - {button ?? ( - + {variableText.map((item, index) => { + return ( + + {index ? ' / ' : ''} + {item} + + ); + })} + + + {!disabled ? ( + + + + ) : null} + + ) : ( +
+ {children && (isFieldValue || !nullable) ? ( + children + ) : ConstantComponent ? ( + + ) : null} +
+ )} + {hideVariableButton ? null : ( + + {button ?? ( + - )} - - )} -
, + type={variable ? 'primary' : 'default'} + disabled={disabled} + /> + )} + + )} + + {/* 确保所有ant input样式都已加载, 放到Compact中会导致Compact中的Input样式不对 */} + + , ); } diff --git a/packages/core/client/src/schema-component/antd/variable/TextArea.tsx b/packages/core/client/src/schema-component/antd/variable/TextArea.tsx index 1a43e849b4..8669c8a3b6 100644 --- a/packages/core/client/src/schema-component/antd/variable/TextArea.tsx +++ b/packages/core/client/src/schema-component/antd/variable/TextArea.tsx @@ -9,7 +9,7 @@ import { css, cx } from '@emotion/css'; import { useForm } from '@formily/react'; -import { Space, theme } from 'antd'; +import { Input as AntInput, Space, theme } from 'antd'; import type { CascaderProps, DefaultOptionType } from 'antd/lib/cascader'; import useInputStyle from 'antd/es/input/style'; import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; @@ -422,95 +422,99 @@ export function TextArea(props: TextAreaProps) { ); const disabled = props.disabled || form.disabled; return wrapSSR( - .x-button { - height: min-content; - } - `, - )} - > - {addonBefore && ( -
- {addonBefore} -
- )} -
+ .x-button { + height: min-content; } `, )} - ref={inputRef} - contentEditable={!disabled} - dangerouslySetInnerHTML={{ __html: html }} - /> - - , + > + {addonBefore && ( +
+ {addonBefore} +
+ )} +
+ + + {/* 确保所有ant input样式都已加载, 放到Compact中会导致Compact中的Input样式不对 */} + + , ); }